我有这个,我不允许触摸HTML。
<div id="dynamic001" class="div-container">
<input type="checkbox" class="checkbox" name="dynamic002" id="dynamic003">
<label for="dynamic003" class="label1">
<div class="div-text" id="dynamic004">
Sample Text
</div>
</div>
有没有办法强制示例文字使用复选框内联,只使用CSS?
答案 0 :(得分:2)
只需将内嵌块添加到div
即可 .div-text {
display: inline-block
}
.div-text {
display: inline-block
}
&#13;
<div id="dynamic001" class="div-container">
<input type="checkbox" class="checkbox" name="dynamic002" id="dynamic003">
<label for="dynamic003" class="label1">
<div class="div-text" id="dynamic004">
Sample Text
</div>
</div>
&#13;