3 回答
TA贡献1744条经验 获得超4个赞
.lowerToppings
{
display: flex;
justify-content: space-around;
}
.LowerToppingsCheckBoxes{
display: inline-block;
display: -moz-inline-box;
*display: inline;
zoom: 2;
width: 200px;
text-align: center;
}
.LowerToppingsCheckBoxes div{display:inline-block;}
<div class="lowerToppings">
<img src="olivee.jpg" width="100" height="100">
<img src="onion.jpg" width="100" height="100">
<img src="bellpepper.jpg" width="100" height="100">
</div>
<br></br>
<div class="LowerToppingsCheckBoxes">
<div><input type="checkbox" id="cheese" name="toppings" value="cheese"></div>
<div><input type="checkbox" id="pepperoni" name="toppings" value="pepperoni"></div>
<div><input type="checkbox" id="mushroom" name="toppings" value="mushroom"></div>
<div><input type="checkbox" id="pepper" name="toppings" value="pepper"></div>
<div><input type="checkbox" id="basil" name="toppings" value="basil"></div>
</div>
TA贡献1880条经验 获得超4个赞
<div class="LowerToppingsCheckBoxes">
<input type="checkbox" id="cheese" name="toppings" value="cheese">
<input type="checkbox" id="pepperoni" name="toppings" value="pepperoni">
<input type="checkbox" id="mushroom" name="toppings" value="mushroom">
<input type="checkbox" id="pepper" name="toppings" value="pepper">
<input type="checkbox" id="basil" name="toppings" value="basil">
</div>
.LowerToppingsCheckBoxes{
...
flex-direction: row; // add this
}
您可以增加容器的宽度以适合所有复选框。
TA贡献1775条经验 获得超11个赞
您可以更改 .LowerToppingsCheckBoxes 的显示以弯曲它会将您的复选框排列在行中
.LowerToppingsCheckBoxes{
display: flex;
display: -moz-inline-box;
zoom: 2;
width: 10%;
text-align: center;
}
- 3 回答
- 0 关注
- 81 浏览
添加回答
举报