【发布时间】:2015-01-01 16:30:56
【问题描述】:
我正在尝试将一些单选按钮水平和垂直居中: http://jsfiddle.net/yxxd0cht/
我正在考虑使用 flexbox 或类似的东西,但我无法让它工作。
CSS:
.costs
{
font-family: Arial, sans-serif;
background-color:#FFBC02;
color:white;
padding: 5px 12px;
margin-left:5px;
font-size: 1.05em;
}
input[type=radio]
{
display:none;
}
HTML:
<div id="green">
<fieldset id="costs">
<legend>Costs: </legend>
<input id="free" name="costs" type="radio" value="free">
<label class="costs" for="free">Free</label>
<input id="chargeable" name="costs" type="radio" value="chargeable">
<label class="costs" for="chargeable">Chargeable</label>
<input id="mixed" name="costs" type="radio" value="mixed" checked>
<label class="costs" for="mixed">Mixed</label>
</fieldset>
</div>
【问题讨论】: