我是HTML5和CSS的新手,所以尝试不同的东西。我创建了一个表单:
<div id="form1">
<form action="demo_form.asp" autocomplete="on" >
Departure City
<br><select name="mydropdown" id="departurecity">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select><br>
Arrival Time
<br><select name="mydropdown">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>
Departure Time
<br><select name="mydropdown">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>
Departure Date
<br><select name="mydropdown">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>
Adult
<br><select name="mydropdown">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>
Child
<br><select name="mydropdown">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>
Senior
<br><select name="mydropdown">
<option value="Milk">Fresh Milk</option>
<option value="Cheese">Old Cheese</option>
<option value="Bread">Hot Bread</option>
</select>
<input type="submit">
</form>
</div>
CSS:
#form1{
border: 1px solid white;
margin: 100px;
width:50%;
position: absolute;
right:0;
bottom:0;
}
现在它位于页面的中心。我想把它移到右边的底部 页。我尝试了很多东西,但没有帮助。你们中的任何人都可以告诉我应该怎样做才能达到我的目的吗?
答案 0 :(得分:0)
#form1{
border: 1px solid white;
width:50%;
position: absolute;
bottom:0;
right:0;
}
答案 1 :(得分:0)
从css中移除边距
#form1{
border: 1px solid white;
width:50%;
position: absolute;
right:0;
bottom:0;
}
当你写margin:100px
时,这意味着你的元素会从四个方面带走100px。
您还可以缩小#form1
的宽度,使其更加正确地查看