如何使表单响应式(是和否标签和答案不响应式)

huangapple go评论75阅读模式
英文:

how to make form responsive (yes and no label and answer is not responsive)

问题

这是我的 HTML 代码和 CSS 代码

代码是响应式的,但是只有“是/否”字段不响应式

/* 样式是响应式的 */
@media (max-width: 600px) {
  /* “是/否”标签样式调整 */
  label[for="moderator-experience-yes"],
  label[for="moderator-experience-no"],
  label[for="contribution-yes"],
  label[for="contribution-no"],
  input[type="radio"][name="moderator-experience"],
  input[type="radio"][name="contribution"],
  input[type="text"],
  input[type="email"] {
    font-size: 20px;
    line-height: 30px;
    margin-bottom: 10px;
  }

  /* 单选按钮样式调整 */
  input[type="radio"][name="moderator-experience"],
  input[type="radio"][name="contribution"] {
    appearance: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    outline: none;
    transition: border-color 0.3s ease-in-out;
    margin-right: 5px;
  }

  input[type="radio"][name="moderator-experience"]:checked,
  input[type="radio"][name="contribution"]:checked {
    border-color: #023047;
  }
}
英文:

Here is my Html code and css code

The code is responsive also but only yes/no filed is not responsive

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

form {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  border: 5px solid #219ebc;
  border-radius: 15px;
  background-color: #fff;
}

/* style the form title */
h1 {
  text-align: center;
  font-size: 36px;
  margin-top: 0;
  color: #023047;
  font-family: Arial, sans-serif;
}

/* style the form fields */
label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  color: #023047;
}

input[type=&quot;text&quot;],
input[type=&quot;email&quot;],
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  border: 3px solid #8ecae6;
  box-sizing: border-box;
  margin-bottom: 20px;
  font-size: 16px;
  font-family: Arial, sans-serif;
  color: #023047;
}

textarea {
  height: 150px;
  resize: none;
}

/* style the submit button */
button[type=&quot;submit&quot;] {
  background-color: #023047;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 24px;
  font-family: Arial, sans-serif;
  transition: all 0.3s ease;
}

button[type=&quot;submit&quot;]:hover {
  background-color: #0077b6;
}

/* style the error messages */
.error {
  color: red;
  margin-bottom: 10px;
  font-family: Arial, sans-serif;
}

/* adjust styles for smaller screens */
@media (max-width: 600px) {
  form {
    max-width: 90%;
    margin: 0 auto;
    padding: 10px;
  }

  input[type=&quot;text&quot;],
  input[type=&quot;email&quot;],
  textarea {
    padding: 5px;
    font-size: 16px;
  }

  textarea {
    height: 100px;
  }

  button[type=&quot;submit&quot;] {
    font-size: 18px;
    padding: 8px 16px;
  }

  /* radio buttons */
  input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
  input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
    appearance: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    outline: none;
    transition: border-color 0.3s ease-in-out;
    margin-right: 5px;
  }

  input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;]:checked,
  input[type=&quot;radio&quot;][name=&quot;contribution&quot;]:checked {
    border-color: #023047;
  }

  label[for=&quot;moderator-experience-yes&quot;],
  label[for=&quot;moderator-experience-no&quot;],
  label[for=&quot;contribution-yes&quot;],
  label[for=&quot;contribution-no&quot;] {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #023047;
    margin-bottom: 10px;
  }

  input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
  input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
    width: 16px;
    height: 16px;}
    @media (max-width: 600px) {
    form {
    max-width: 90%;
    margin: 0 auto;
    padding: 10px;
    }
    
    input[type=&quot;text&quot;],
    input[type=&quot;email&quot;],
    textarea {
    padding: 5px;
    font-size: 16px;
    }
    
    textarea {
    height: 100px;
    }
    
    button[type=&quot;submit&quot;] {
    font-size: 18px;
    padding: 8px 16px;
    }
    
    /* radio buttons */
    input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
    input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
    appearance: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    outline: none;
    transition: border-color 0.3s ease-in-out;
    margin-right: 5px;
    }
    
    input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;]:checked,
    input[type=&quot;radio&quot;][name=&quot;contribution&quot;]:checked {
    border-color: #023047;
    }
    
    label[for=&quot;moderator-experience-yes&quot;],
    label[for=&quot;moderator-experience-no&quot;],
    label[for=&quot;contribution-yes&quot;],
    label[for=&quot;contribution-no&quot;] {
    display: inline-block;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #023047;
    margin-bottom: 10px;
    margin-right: 10px;
    }
    
    input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
    input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
    width: 16px;
    height: 16px;
    }
    }
  /* adjust styles for smaller screens */
@media (max-width: 600px) {
  /* radio buttons */
label[for=&quot;moderator-experience-yes&quot;],
label[for=&quot;moderator-experience-no&quot;],
label[for=&quot;contribution-yes&quot;],
label[for=&quot;contribution-no&quot;],
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;],
input[type=&quot;text&quot;],
input[type=&quot;email&quot;] {
    font-size: 20px;
    line-height: 30px;
    margin-bottom: 10px;
}
  input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
  input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
    appearance: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    outline: none;
    transition: border-color 0.3s ease-in-out;
    margin-right: 5px;
  }

  input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;]:checked,
  input[type=&quot;radio&quot;][name=&quot;contribution&quot;]:checked {
    border-color: #023047;
  }

  label[for=&quot;moderator-experience-yes&quot;],
  label[for=&quot;moderator-experience-no&quot;],
  label[for=&quot;contribution-yes&quot;],
  label[for=&quot;contribution-no&quot;] {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #023047;
    margin-bottom: 10px;
  }

  input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
  input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
    width: 16px;
    height: 16px;
  }

  /* answer fields */
  .answer {
    display: block;
    margin-bottom: 20px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #023047;
  }

  .answer input[type=&quot;text&quot;] {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 3px solid #8ecae6;
    box-sizing: border-box;
    margin-bottom: 10px;
    font-size: 16px;
    font-family: Arial, sans-serif;
    color: #023047;
  }

  .answer textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: 5px;
    border: 3px solid #8ecae6;
    box-sizing: border-box;
    margin-bottom: 20px;
    font-size: 16px;
    font-family: Arial, sans-serif;
    color: #023047;
  }
}

<!-- language: lang-html -->

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Mod Application Form&lt;/title&gt;
   &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;{% static &#39;css/style-form.css&#39; %}&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;h1 id=&quot;mod-text&quot;&gt;Mod Application Questions&lt;/h1&gt;
	&lt;form id=&quot;mod-application-form&quot;&gt;
		&lt;label for=&quot;excitement&quot;&gt;1. What makes you excited to become a part of our staff team?&lt;/label&gt;&lt;br&gt;
		&lt;textarea id=&quot;excitement&quot; name=&quot;excitement&quot; required&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;time-commitment&quot;&gt;2. How much time can you dedicate to our server on a regular basis?&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;text&quot; id=&quot;time-commitment&quot; name=&quot;time-commitment&quot; required&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;messages-commitment&quot;&gt;3. How many messages can you commit to writing each day as a staff member?&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;text&quot; id=&quot;messages-commitment&quot; name=&quot;messages-commitment&quot; required&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;rule-breaking-action&quot;&gt;4. If you come across a member who is breaking our rules, what actions would you take?&lt;/label&gt;&lt;br&gt;
		&lt;textarea id=&quot;rule-breaking-action&quot; name=&quot;rule-breaking-action&quot; required&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;moderator-experience&quot;&gt;5. Have you had any previous experience as a moderator on other servers?&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;radio&quot; id=&quot;moderator-experience-yes&quot; name=&quot;moderator-experience&quot; value=&quot;yes&quot; required&gt;
		&lt;label for=&quot;moderator-experience-yes&quot;&gt;Yes&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;radio&quot; id=&quot;moderator-experience-no&quot; name=&quot;moderator-experience&quot; value=&quot;no&quot; required&gt;
		&lt;label for=&quot;moderator-experience-no&quot;&gt;No&lt;/label&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;largest-membership&quot;&gt;6. What is the largest number of members you&#39;ve moderated on previous servers?&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;text&quot; id=&quot;largest-membership&quot; name=&quot;largest-membership&quot; required&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;typing-speed&quot;&gt;7. What is your typing speed (in words per minute)?&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;text&quot; id=&quot;typing-speed&quot; name=&quot;typing-speed&quot; required&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;staff-role-removal&quot;&gt;8. If your staff role is taken away due to inactivity or any other reason, how would you react?&lt;/label&gt;&lt;br&gt;
		&lt;textarea id=&quot;staff-role-removal&quot; name=&quot;staff-role-removal&quot; required&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;label for=&quot;contribution&quot;&gt;9. Are you willing to contribute your owo/bot coins to support events and activities on our server?&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;radio&quot; id=&quot;contribution-yes&quot; name=&quot;contribution&quot; value=&quot;yes&quot; required&gt;
		&lt;label for=&quot;contribution-yes&quot;&gt;Yes&lt;/label&gt;&lt;br&gt;
		&lt;input type=&quot;radio&quot; id=&quot;contribution-no&quot; name=&quot;contribution&quot; value=&quot;no&quot; required&gt;
		&lt;label for=&quot;contribution-no&quot;&gt;No&lt;/label&gt;&lt;br&gt;&lt;br&gt;
		
		&lt;input style=&quot;background-color: #008CBA;
  color: #00ffee;
  padding: 30px 275px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;&quot; type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
	&lt;/form&gt;
	&lt;script&gt;
		document.getElementById(&quot;mod-application-form&quot;).addEventListener(&quot;submit&quot;, (function(event) {
event.preventDefault(); // prevent the default form submission
// get the form data and format it as a string
const formData = new FormData(event.target);
let formString = &#39;&#39;;
for (const [name, value] of formData.entries()) {
formString +=`${name}: ${value}\n`;
}
// send the form data as an email
const emailBody = encodeURIComponent(formString);
const emailLink = `mailto:mymai@gmail.com?subject=Mod%20Application&amp;body=${emailBody}`;
window.location.href = emailLink;
}));
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;

<!-- end snippet -->

I am trying to make the page responsive everything is ok but Yes/No label and answer filled is not responsive
please tell me how to make yes/no label responsive
I have attched whole html, javascript and css with media query

答案1

得分: 1

你的标签被设置为display:block,所以它们会换行显示。要让它们在同一行上显示,请将它们设置为display:inline。我已经添加了相应的CSS行。你还有两个相同宽度的媒体查询。建议你删除其中一个。

英文:

Your labels are set as display:block so they drop on to a new line. To make them appear on the same line then set them to display:inline. I've added a line of CSS for this. You've also got two media queries for the same width. Suggest you delete one.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

    form {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
      border: 5px solid #219ebc;
      border-radius: 15px;
      background-color: #fff;
      font-family: Arial, sans-serif;
      color: #023047;
    }

    /* style the form title */
    h1 {
      text-align: center;
      font-size: 36px;
      margin-top: 0;
    }

    /* style the form fields */
    label {
      display: block;
      margin-bottom: 10px;
      font-weight: bold;
    }

    /*added this */
    label:is([for=&quot;moderator-experience-yes&quot;],[for=&quot;moderator-experience-no&quot;],
  [for=&quot;contribution-yes&quot;],[for=&quot;contribution-no&quot;]) {
    display:inline;
  }

    /* adjust styles for smaller screens */
    @media (max-width: 600px) {
      form {
        max-width: 90%;
        margin: 0 auto;
        padding: 10px;
      }

      /* radio buttons */
      /* not needed */ 
    }

<!-- language: lang-html -->

  &lt;h1 id=&quot;mod-text&quot;&gt;Mod Application Questions&lt;/h1&gt;
  &lt;form id=&quot;mod-application-form&quot;&gt;
    &lt;label for=&quot;moderator-experience&quot;&gt;5. Have you had any previous experience as a moderator on other
      servers?&lt;/label&gt;&lt;br&gt;
    &lt;input type=&quot;radio&quot; id=&quot;moderator-experience-yes&quot; name=&quot;moderator-experience&quot; value=&quot;yes&quot; required&gt;
    &lt;label for=&quot;moderator-experience-yes&quot;&gt;Yes&lt;/label&gt;&lt;br&gt;
    &lt;input type=&quot;radio&quot; id=&quot;moderator-experience-no&quot; name=&quot;moderator-experience&quot; value=&quot;no&quot; required&gt;
    &lt;label for=&quot;moderator-experience-no&quot;&gt;No&lt;/label&gt;&lt;br&gt;&lt;br&gt;
  &lt;/form&gt;

<!-- end snippet -->

答案2

得分: 0

以下是您的 HTML 代码的翻译部分:

我为您创建了一个HTML文档的解决方案,使用div元素,您可以参考以下内容:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + React</title>
    <style>
      /* 以下是样式部分,略 */
    </style>
  </head>
  <body>
    <div id="root"></div>
    <h1 id="mod-text">Mod Application Questions</h1>
    <form id="mod-application-form">
      <!-- 表单内容略 -->
    </form>
    <script>
      /* JavaScript 部分略 */
    </script>
  </body>
</html>
.radion-btns,
.radion-btn {
  display: flex;
}

<div class="radion-btns">
  <div class="radion-btn">
    <input
      type="radio"
      id="moderator-experience-yes"
      name="moderator-experience"
      value="yes"
      required
    />
    <label for="moderator-experience-yes">是</label><br />
  </div>
  <div class="radion-btn">
    <input
      type="radio"
      id="moderator-experience-no"
      name="moderator-experience"
      value="no"
      required
    />
    <label for="moderator-experience-no">否</label>
  </div>
</div>

请注意,这是您代码的一部分,已经进行了翻译。如果您需要更多部分的翻译,请提供具体的内容。

英文:

I create A Solution for you HTML Document , using div element , you can reefer this

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot; /&gt;
&lt;link rel=&quot;icon&quot; type=&quot;image/svg+xml&quot; href=&quot;/vite.svg&quot; /&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;
&lt;title&gt;Vite + React&lt;/title&gt;
&lt;style&gt;
form {
max-width: 600px;
margin: 0 auto;
padding: 20px;
border: 5px solid #219ebc;
border-radius: 15px;
background-color: #fff;
}
/* style the form title */
h1 {
text-align: center;
font-size: 36px;
margin-top: 0;
color: #023047;
font-family: Arial, sans-serif;
}
/* style the form fields */
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
font-family: Arial, sans-serif;
color: #023047;
}
input[type=&quot;text&quot;],
input[type=&quot;email&quot;],
textarea {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 3px solid #8ecae6;
box-sizing: border-box;
margin-bottom: 20px;
font-size: 16px;
font-family: Arial, sans-serif;
color: #023047;
}
textarea {
height: 150px;
resize: none;
}
/* style the submit button */
button[type=&quot;submit&quot;] {
background-color: #023047;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 24px;
font-family: Arial, sans-serif;
transition: all 0.3s ease;
}
button[type=&quot;submit&quot;]:hover {
background-color: #0077b6;
}
/* style the error messages */
.error {
color: red;
margin-bottom: 10px;
font-family: Arial, sans-serif;
}
/* adjust styles for smaller screens */
@media (max-width: 600px) {
form {
max-width: 90%;
margin: 0 auto;
padding: 10px;
}
input[type=&quot;text&quot;],
input[type=&quot;email&quot;],
textarea {
padding: 5px;
font-size: 16px;
}
textarea {
height: 100px;
}
button[type=&quot;submit&quot;] {
font-size: 18px;
padding: 8px 16px;
}
.radion-btns,
.radion-btn {
display: flex;
}
}
/* radio buttons */
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
appearance: none;
border-radius: 50%;
width: 20px;
height: 20px;
border: 2px solid #ccc;
outline: none;
transition: border-color 0.3s ease-in-out;
margin-right: 5px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;]:checked,
input[type=&quot;radio&quot;][name=&quot;contribution&quot;]:checked {
border-color: #023047;
}
label[for=&quot;moderator-experience-yes&quot;],
label[for=&quot;moderator-experience-no&quot;],
label[for=&quot;contribution-yes&quot;],
label[for=&quot;contribution-no&quot;] {
display: block;
font-family: Arial, sans-serif;
font-size: 16px;
color: #023047;
margin-bottom: 10px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
width: 16px;
height: 16px;
}
@media (max-width: 600px) {
form {
max-width: 90%;
margin: 0 auto;
padding: 10px;
}
input[type=&quot;text&quot;],
input[type=&quot;email&quot;],
textarea {
padding: 5px;
font-size: 16px;
}
textarea {
height: 100px;
}
button[type=&quot;submit&quot;] {
font-size: 18px;
padding: 8px 16px;
}
/* radio buttons */
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
appearance: none;
border-radius: 50%;
width: 20px;
height: 20px;
border: 2px solid #ccc;
outline: none;
transition: border-color 0.3s ease-in-out;
margin-right: 5px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;]:checked,
input[type=&quot;radio&quot;][name=&quot;contribution&quot;]:checked {
border-color: #023047;
}
label[for=&quot;moderator-experience-yes&quot;],
label[for=&quot;moderator-experience-no&quot;],
label[for=&quot;contribution-yes&quot;],
label[for=&quot;contribution-no&quot;] {
display: inline-block;
font-family: Arial, sans-serif;
font-size: 16px;
color: #023047;
margin-bottom: 10px;
margin-right: 10px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
width: 16px;
height: 16px;
}
}
/* adjust styles for smaller screens */
@media (max-width: 600px) {
/* radio buttons */
label[for=&quot;moderator-experience-yes&quot;],
label[for=&quot;moderator-experience-no&quot;],
label[for=&quot;contribution-yes&quot;],
label[for=&quot;contribution-no&quot;],
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;],
input[type=&quot;text&quot;],
input[type=&quot;email&quot;] {
font-size: 20px;
line-height: 30px;
margin-bottom: 10px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
appearance: none;
border-radius: 50%;
width: 20px;
height: 20px;
border: 2px solid #ccc;
outline: none;
transition: border-color 0.3s ease-in-out;
margin-right: 5px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;]:checked,
input[type=&quot;radio&quot;][name=&quot;contribution&quot;]:checked {
border-color: #023047;
}
label[for=&quot;moderator-experience-yes&quot;],
label[for=&quot;moderator-experience-no&quot;],
label[for=&quot;contribution-yes&quot;],
label[for=&quot;contribution-no&quot;] {
display: block;
font-family: Arial, sans-serif;
font-size: 16px;
color: #023047;
margin-bottom: 10px;
}
input[type=&quot;radio&quot;][name=&quot;moderator-experience&quot;],
input[type=&quot;radio&quot;][name=&quot;contribution&quot;] {
width: 16px;
height: 16px;
}
/* answer fields */
.answer {
display: block;
margin-bottom: 20px;
font-weight: bold;
font-family: Arial, sans-serif;
color: #023047;
}
.answer input[type=&quot;text&quot;] {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 3px solid #8ecae6;
box-sizing: border-box;
margin-bottom: 10px;
font-size: 16px;
font-family: Arial, sans-serif;
color: #023047;
}
.answer textarea {
width: 100%;
height: 100px;
padding: 10px;
border-radius: 5px;
border: 3px solid #8ecae6;
box-sizing: border-box;
margin-bottom: 20px;
font-size: 16px;
font-family: Arial, sans-serif;
color: #023047;
}
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;root&quot;&gt;&lt;/div&gt;
&lt;h1 id=&quot;mod-text&quot;&gt;Mod Application Questions&lt;/h1&gt;
&lt;form id=&quot;mod-application-form&quot;&gt;
&lt;label for=&quot;excitement&quot;
&gt;1. What makes you excited to become a part of our staff team?&lt;/label
&gt;&lt;br /&gt;
&lt;textarea id=&quot;excitement&quot; name=&quot;excitement&quot; required&gt;&lt;/textarea
&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;time-commitment&quot;
&gt;2. How much time can you dedicate to our server on a regular
basis?&lt;/label
&gt;&lt;br /&gt;
&lt;input
type=&quot;text&quot;
id=&quot;time-commitment&quot;
name=&quot;time-commitment&quot;
required
/&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;messages-commitment&quot;
&gt;3. How many messages can you commit to writing each day as a staff
member?&lt;/label
&gt;&lt;br /&gt;
&lt;input
type=&quot;text&quot;
id=&quot;messages-commitment&quot;
name=&quot;messages-commitment&quot;
required
/&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;rule-breaking-action&quot;
&gt;4. If you come across a member who is breaking our rules, what actions
would you take?&lt;/label
&gt;&lt;br /&gt;
&lt;textarea
id=&quot;rule-breaking-action&quot;
name=&quot;rule-breaking-action&quot;
required
&gt;&lt;/textarea
&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;moderator-experience&quot;
&gt;5. Have you had any previous experience as a moderator on other
servers?&lt;/label
&gt;&lt;br /&gt;
&lt;div class=&quot;radion-btns&quot;&gt;
&lt;div class=&quot;radion-btn&quot;&gt;
&lt;input
type=&quot;radio&quot;
id=&quot;moderator-experience-yes&quot;
name=&quot;moderator-experience&quot;
value=&quot;yes&quot;
required
/&gt;
&lt;label for=&quot;moderator-experience-yes&quot;&gt;Yes&lt;/label&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;radion-btns&quot;&gt;
&lt;input
type=&quot;radio&quot;
id=&quot;moderator-experience-no&quot;
name=&quot;moderator-experience&quot;
value=&quot;no&quot;
required
/&gt;
&lt;label for=&quot;moderator-experience-no&quot;&gt;No&lt;/label&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;largest-membership&quot;
&gt;6. What is the largest number of members you&#39;ve moderated on previous
servers?&lt;/label
&gt;&lt;br /&gt;
&lt;input
type=&quot;text&quot;
id=&quot;largest-membership&quot;
name=&quot;largest-membership&quot;
required
/&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;typing-speed&quot;
&gt;7. What is your typing speed (in words per minute)?&lt;/label
&gt;&lt;br /&gt;
&lt;input
type=&quot;text&quot;
id=&quot;typing-speed&quot;
name=&quot;typing-speed&quot;
required
/&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;staff-role-removal&quot;
&gt;8. If your staff role is taken away due to inactivity or any other
reason, how would you react?&lt;/label
&gt;&lt;br /&gt;
&lt;textarea
id=&quot;staff-role-removal&quot;
name=&quot;staff-role-removal&quot;
required
&gt;&lt;/textarea
&gt;&lt;br /&gt;&lt;br /&gt;
&lt;label for=&quot;contribution&quot;
&gt;9. Are you willing to contribute your owo/bot coins to support events
and activities on our server?&lt;/label
&gt;&lt;br /&gt;
&lt;div class=&quot;radion-btns&quot;&gt;
&lt;div class=&quot;radion-btn&quot;&gt;
&lt;input
type=&quot;radio&quot;
id=&quot;contribution-yes&quot;
name=&quot;contribution&quot;
value=&quot;yes&quot;
required
/&gt;
&lt;label for=&quot;contribution-yes&quot;&gt;Yes&lt;/label&gt;
&lt;/div&gt;
&lt;div class=&quot;radion-btn&quot;&gt;
&lt;input
type=&quot;radio&quot;
id=&quot;contribution-no&quot;
name=&quot;contribution&quot;
value=&quot;no&quot;
required
/&gt;
&lt;label for=&quot;contribution-no&quot;&gt;No&lt;/label&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;input
style=&quot;
background-color: #008cba;
color: #00ffee;
padding: 30px 275px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
&quot;
type=&quot;submit&quot;
value=&quot;Submit&quot;
/&gt;
&lt;/form&gt;
&lt;script&gt;
document
.getElementById(&quot;mod-application-form&quot;)
.addEventListener(&quot;submit&quot;, function (event) {
event.preventDefault(); // prevent the default form submission
// get the form data and format it as a string
const formData = new FormData(event.target);
let formString = &quot;&quot;;
for (const [name, value] of formData.entries()) {
formString += `${name}: ${value}\n`;
}
// send the form data as an email
const emailBody = encodeURIComponent(formString);
const emailLink = `mailto:mymai@gmail.com?subject=Mod%20Application&amp;body=${emailBody}`;
window.location.href = emailLink;
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

<!-- end snippet -->

        .radion-btns,
.radion-btn {
display: flex;
}
&lt;div class=&quot;radion-btns&quot;&gt;
&lt;div class=&quot;radion-btn&quot;&gt;
&lt;input
type=&quot;radio&quot;
id=&quot;moderator-experience-yes&quot;
name=&quot;moderator-experience&quot;
value=&quot;yes&quot;
required
/&gt;
&lt;label for=&quot;moderator-experience-yes&quot;&gt;Yes&lt;/label&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;radion-btns&quot;&gt;
&lt;input
type=&quot;radio&quot;
id=&quot;moderator-experience-no&quot;
name=&quot;moderator-experience&quot;
value=&quot;no&quot;
required
/&gt;
&lt;label for=&quot;moderator-experience-no&quot;&gt;No&lt;/label&gt;
&lt;/div&gt;
&lt;/div&gt;

huangapple
  • 本文由 发表于 2023年4月13日 15:50:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76002926.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定