Hol*_*lly 3 html css forms positioning fieldset
我有以下代码:
<fieldset>
<legend>
<strong>Personal Information</strong>
</legend>
<ul>
<li>
<label for="first_name">First Name</label><br />
<input type="text" id="first_name" name="first_name" value="" maxlength="30" />
</li>
...
</ul>
</fieldset>
<fieldset>
<legend>
<strong>Car Information</strong>
</legend>
<ul>
<li>
<label for="car_make">Make</label><br />
<input type="text" id="car_make" name="car_make" value="" maxlength="30" />
</li>
...
</ul>
</fieldset>
Run Code Online (Sandbox Code Playgroud)
现在,所有内容都位于左侧,第二个字段集(汽车信息)位于第一个字段集(个人信息)的正下方。
我希望汽车信息字段集位于个人信息字段集的右侧,以便它们并排。使用CSS,我该如何做到这一点?
由于字段集被视为块,因此您需要使用
fieldset {
width: 200px;
float: left;
}
Run Code Online (Sandbox Code Playgroud)
或者任何你想要的字段集宽度。