I'm totally new in HTML and try to make a website all is good but when I restore down the browser all the element will sepperate. Watched youtube about max-width but still not working and I'm stuck like 3 day.
This is my code for a form, the form was in a div class named bothForm and requestQuotationForm
.requestQuotationForm{
position: relative;
left: 800px;
top: -305px;
background: rgba(41, 29, 0,0.5);
border-radius: 10px;
padding: 20px;
color: white;
font-family: 'PT Sans', sans-serif;
font-size: 14px;
max-width: 300px;
}
.mainBody {
width: 1500px;
margin : 0 auto;
}
@media screen and (max-width: 500px) {
.mainBody {
width: 95%;
}
.bothForm {
max-width: 100%;
}
}
<div class = "requestQuotationForm">
<form>
<p class="requestQuotationText"><center>Request quotation </center></p>
<label for = "ICNumber">IC Number</label>
<input type="text" onfocus="this.value=''" id= "ICNumber" name="ICNumber" value = "Enter your IC number"> <br> <br>
<label for = "FlatNumber">Plate Number</label>
<input type="text" onfocus="this.value=''" id= "FlatNumber" name="FlatNumber" value = "Enter your plate number"> <br> <br>
<label for = "carModel">Plate Number</label>
<input type="text" onfocus="this.value=''" id= "carModel" name="carModel" value = "Enter your car model"> <br> <br>
<label for ="chooseInsurance">Choose insurance</label>
<select class ="chooseInsurance">
<option value = "Etiqa">Etiqa</option>
<option value = "Ikhlas">Ikhlas</option>
<option value = "AXA">AXA</option>
</select>
<label for = "PhoneNumber">Phone Number</label>
<input type="text" onfocus="this.value=''" id= "PhoneNumber" name="PhoneNumber" value = "Enter your phone number"> <br> <br>
<input type="button" value="Submit" id="RequestQuotationButton" >
</form>
</div>