我想中心(页面中)使用CSS HTML表单。
我已经看过其他成员的有点类似的问题。 但是,我不知道这一点
这是HTML表单:
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/form_style.css">
<title>My Form</title>
</head>
<body>
<form action="#">
<label for="name">Your Name:</label>
<input type="text" name="name" id="name" /><br />
<label for="email">Your Email:</label>
<input type="text" name="email" id="email" /><br />
<input type="checkbox" name="subscribe" id="subscribe" />
<label for="subscribe" class="check">Subscribe</label>
</form>
</div>
</body>
</html>
这是CSS:
<style>
form{
width: 700px ;
margin-left: 0 auto;
}
label {
text-align:right;
width:100px;
}
input {
margin-left: 10px;
}
label.check, label.radio {
text-align:left;
}
</style>
我试过很长一段时间。 但我仍不能居中形式。 任何指导做好? 谢谢