Html 工作。在我的另一段代码中,它们彼此之间的距离仍然很小,但我会弄明白这一点。再次感谢你,伙计。 @media(max-width:575px){ /*APPLY WHATEVER STYLING YOU WANT TO HAPPEN WHEN THE SCR
工作。在我的另一段代码中,它们彼此之间的距离仍然很小,但我会弄明白这一点。再次感谢你,伙计。Html 工作。在我的另一段代码中,它们彼此之间的距离仍然很小,但我会弄明白这一点。再次感谢你,伙计。 @media(max-width:575px){ /*APPLY WHATEVER STYLING YOU WANT TO HAPPEN WHEN THE SCR,html,css,forms,input,Html,Css,Forms,Input,工作。在我的另一段代码中,它们彼此之间的距离仍然很小,但我会弄明白这一点。再次感谢你,伙计。 @media(max-width:575px){ /*APPLY WHATEVER STYLING YOU WANT TO HAPPEN WHEN THE SCREEN IS RESIZED TO 575PX*/ .yourClassName{ width:whatEverWidthYouWant } } <div class="form-container">
@media(max-width:575px){
/*APPLY WHATEVER STYLING YOU WANT TO HAPPEN WHEN THE SCREEN IS RESIZED TO 575PX*/
.yourClassName{
width:whatEverWidthYouWant
}
}
<div class="form-container">
<form>
<div class="form-group1 form-group">
<label>First name</label>
<input>
</div>
<div class="form-group2 form-group">
<label>Last name</label>
<input>
</div>
<label>E-mail</label>
<input id="email">
<label class="date-of-birth">Date of Birth</label>
<div class="mail-padding">
<select id="dob-day" name="dob">
<option value="1">1</option>
<option value="2">2</option>
</select>
<select id="dob-month" name="dob">
<option value="jan">Jan</option>
<option value="feb">Feb</option>
</select>
</div>
</form> </div>
body {
background-color: #000;
color: white;
font-size: 25px;
text-align: center;
}
form {
margin-top: 15%;
}
label {
display: block;
margin-top: 10px;
font-size: 60%;
}
/* <label> tag for 'Date of Birth' */
.date-of-birth {
margin-bottom: 25px;
margin-top: 20px;
text-align: center;
}
/* styles the 'First name', 'Last name' and 'E-mail' boxes */
input {
width: 94%;
height: 50px;
background-color: #000;
border: 2px solid #fff;
margin-top: 3px;
}
/* The 'Day' and 'Month' dropdown boxes */
select {
width: 47%;
height: 50px;
background-color: transparent;
color: #fff;
border: 2px solid #fff;
margin-top: -8px;
margin-bottom: 20px;
padding-left: 15px;
}
.form-group {
display: inline-block;
width: 47.2%;
margin-bottom: 10px;
}
/* Pushes both boxes to the sides */
.form-group1 {
margin-right: 8px;
}
@media only screen and (min-width: 575px) {
.form-container {
display: flex;
justify-content: center;
}
form {
flex: 1;
max-width: 575px;
}
}
@media only screen and (min-width: 575px){
.mail-padding {
padding: 20px 150px 0 150px;
max-width: 575px;
box-sizing: border-box;
margin-left: auto;
margin-right: auto;
}
}