缩进多行标签 [英] Indenting multiline labels
本文介绍了缩进多行标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下自动生成的HTML:
I have the following automatically-generated HTML:
使用CSS来缩进标签的建议方法是什么,以便在收音机下有一些空白
What is the advised way, using CSS, to indent the label so that there's some white space under the radio button?
推荐答案
label {
display: block;
margin-left: 20px;
}
input {
float: left;
margin-left: -20px;
margin-right: 7px;
}
这是小提琴: http://jsfiddle.net/hrfmt/ 。播放值。
Here's the fiddle: http://jsfiddle.net/hrfmt/ . Play with the values.
编辑:
如果需要所有浏览器支持可以理解 display:inline-block
,使用它代替 float
。
If all the browsers you need to support can understand display: inline-block
, use that instead of float
.
这篇关于缩进多行标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文