html:
<form id="personal_info" action="..." method="post">
<legend>Personal info</legend>
<p>
<label for="fullname">Your name: </label>
<input name="fullname" id="fullname" type="text" tabindex="1" />
</p>
<p>
<label for="email">Your e-mail: </label>
<input name="email" id="email" type="text" tabindex="2" />
</p>
<p><input id="send" type="submit" value="Send" /></p>
</form>
CSS:
form#personal_info {
background:#dee;
width:470px;
padding:10px;
border:1px solid #000;
margin:0;
}
form#personal_info legend {
font-family:georgia, sans-serif;
font-size:1.1em;
font-weight:bold;
border:3px solid #fff;
margin-bottom:5px;
padding:3px;
width:270px;
background:#fff url(legend.gif) repeat-x center left;
}
form#personal_info label {
clear:left;
display:block;
float:left;
width:100px;
text-align:right;
padding-right:10px;
color:#888;
margin-bottom:0.5em;
}
form#personal_info input {
border:1px solid #fff;
background:#fff url(legend.gif) repeat-x top left;
padding-left:0.5em;
margin-bottom:0.6em;width:300px;
}
form#personal_info #button1 {
color:#c00;
padding-right:0.5em;
cursor:pointer;
margin-left:8px;
width:100px;
}
form#personal_info #button1:hover {
background-position:center left;
color:#000;
width:100px;
}
输入和按钮的宽度相同,均为 300 像素,但我希望按钮的宽度为 100 像素。怎么了?