我有一个垂直出现的表格:
<form action="roseresult.php" method="POST" id='rosesearch'>
<label>Latin Name:</label><input name='latin_name' type='text' />
<label>Common Name:</label><input name='common_name_name' type='text' /></br>
<label>Variety Type:</label><select name="variety">
<option value="Any">Any</option>
<option value="Climber/Rambler">Climber/Rambler</option>
<option value="David Austin">David Austin</option>
<option value="Floribunda">Floribunda</option>
<option value="Groundcover">Groundcover</option>
<option value="Hybrid Tea">Hybrid Tea</option>
<option value="Patio/Miniature">Patio/Miniature</option>
<option value="Shrub">Shrub</option></select>
<input name='search' type='submit' value='Search' />
</form>
我已经在 css 中对其进行了编辑以尝试使其水平显示,但它似乎不起作用。我以为浮动:左;会这样做,但它不会。
CSS:
#rosesearch {
width:400px;
border-color:#7f2e3f;
padding: 5px 500px 5px 5px;
float:left;
}
#rosesearch legend {
background-color:#7f2e3f;
width:200px;
font-size: 20px;
}
#rosesearch label {
display:block;
font-weight:bold;
text-align:right;
width:140px;
font-size:1.1em;
float:left;
color:#000000;
}
#rosesearch input {
font-size:12px;
padding:4px 2px;
border:solid 1px #000000;
width:244px;
margin:2px 0 20px 10px;
color:#000000;
float:left
}
有没有其他方法可以使表单水平显示?