问问题
3649 次
2 回答
5
我认为您不应该(可以?)<option>
像这样使元素内联。尝试改用复选框。像这样的东西:
<!DOCTYPE html>
<html>
<head>
<title>Inline Options</title>
<style>
ul {
list-style:none;overflow:hidden;
}
ul li {
lit-style:none;
float:left;
position:relative;
}
ul li input[type="checkbox"] {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
width:100%;
height:100%;
opacity:0;
}
ul li input:checked + label {
background:blue;
}
</style>
</head>
<body>
<form action="#" method="get">
<ul>
<li>
<input type="checkbox" name="aryHours[]" id="checkbox1" />
<label for="checkbox1" class="">Option 1</label>
</li>
<li>
<input type="checkbox" name="aryHours[]" id="checkbox2" />
<label for="checkbox2" class="">Option 2</label>
</li>
<li>
<input type="checkbox" name="aryHours[]" id="checkbox3" />
<label for="checkbox3" class="">Option 3</label>
</li>
</ul>
</form>
</body>
</html>
于 2012-08-31T18:16:20.390 回答
0
于 2018-01-17T22:22:42.087 回答