我从一本书中得到了这个简单的 HTML 片段(表单):
<form action="example.php" method="post">
<div>
<label for="name" class="title">Name:</label>
<input type="text" id="name" name="name" />
</div>
<div>
<label for="email" class="title">Email:</label>
<input type="email" id="email" name="email" />
</div>
<div>
<span class="title">Gender:</span>
<input type="radio" name="gender" id="male" value="M" />
<label for="male">Male</label>
<input type="radio" name="gender" id="female" value="F" />
<label for="female">Female</label> <br/>
</div>
<div>
<input type="submit" value="Register" id="submit" />
</div>
然后我将它与以下 CSS 代码结合起来:
div {
border-bottom: 2px solid #efefef;
margin: 10px;
padding-bottom: 10px;
width: 260px;
}
.title {
float: left;
width: 100px;
text-align: right;
padding-right: 10px;
}
#submit {
text-align: right;
color: red;
}
问题是我无法对齐表单底部的“注册”按钮。我在这里想念什么?
提前致谢。