This is all HTML Code:
<div class="container">
<h1>Job Application Form</h1>
<form action="">
<label for="name" class="label">Full Name:</label>
<input
id="name"
type="text"
name="name"
placeholder="Enter your name"
required
/>
<label for="email" class="label">Email:</label>
<input
id="email"
type="email"
name="email"
placeholder="Enter your email"
required
/>
<label for="position" class="label">Position:</label>
<select id="position" name="position" required>
<option value="">Select a position</option>
<option value="developer">Developer</option>
<option value="designer">Designer</option>
<option value="manager">Manager</option>
</select>
<fieldset class="radio-group">
<legend>Availability:</legend>
<input id="selection1" type="radio" name="availability" checked />
<label for="selection1">Full-Time</label>
<input id="selection2" type="radio" name="availability" />
<label for="selection2">Part-Time</label>
</fieldset>
<label for="message" class="label">Why do you want this job?</label>
<textarea
id="message"
name="message"
placeholder="Write your motivation"
required
></textarea>
<button type="submit">Submit Application</button>
</form>
</div>
This is all CSS Code:
#message {
min-height: 100px;
margin-bottom: 10px;
}
.container {
max-width: 80%;
border-radius: 5px;
box-shadow: 0 5px 10px rgb(202, 202, 202);
margin: 0 auto;
padding: 20px;
}
.label {
font-weight: bold;
}
.radio-group {
padding-bottom: 20px;
}
input:focus,
textarea:focus {
border: 1px solid yellow;
}
input:invalid,
select:invalid,
textarea:invalid {
border: 1px solid red;
}
input:valid,
select:valid,
textarea:valid {
border: 1px solid green;
}
.radio-group input[type="radio"] {
margin-right: 5px;
appearance: none;
width: 20px;
height: 20px;
border: 2px solid #ccc;
border-radius: 50%;
transition:border 0.3s ease ;
}
.radio-group input[type="radio"]:checked {
border-color: green;
background-color: green;
box-shadow: inset 0 0 0 3.5px white;
}
input[type="radio"]:checked + label {
color: green;
cursor: pointer;
}
button:hover {
cursor: pointer;
background-color: black;
}
button {
border: hidden;
border-radius: 2px;
width: 100%;
color: white;
background-color: green;
padding: 10px;
}
body {
font-family: Arial, sans-serif;
padding-top: 20px;
}
h1 {
text-align: center;
}
:where(#name, #position, #email, #message) {
border-radius: 2px;
padding: 10px;
width: 100%;
margin: 5px 0px 10px 0px;
box-sizing: border-box;
}
And I donât know why the margin-right for the input is not worked as expected, I will show it below:
Origin:
Modified:(The value is exaggerated)
But Margins for other sides of inputs are all worked.Is their any chance that it is beacuse of the input width which is 100% or something else like the display forms?I am really confused about it!Pre-thanks for trying to answer me!!!