我想禁用或隐藏内容“分组”
的 <label>
标记而不影响嵌套 <input>
标签。
<label class="" for="officersheet_fields_attributes_3_grouping">
<input type="checkbox" id="officersheet_fields_attributes_3_grouping" name="officersheet[fields_attributes][3][grouping]" value="1">
Grouping
</label>`
我在 Rails 中使用 formtastic。
formtastic 代码片段
<td><%= f.input :grouping %></td>
上面的行生成上面的 html。
提前致谢
最佳答案
您可以使用text-indent: -1000em
。
label
{
text-indent: -1000em;
}
但我不认为将输入放在标签内是个好主意。最好有以下内容:
<input type="checkbox"/><label>Grouping</label>
关于html - 隐藏标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15357198/