我想用最少的CSS元素,以实现在CSS以下路线:CSS图标垂直对齐
中东:
==============================================================
= [icon] =
= [ ] Text =
= [ ] =
==============================================================
底:
==============================================================
= [icon] =
= [ ] =
= [ ] Text =
==============================================================
右中:
==============================================================
= [ ] =
= Text [ ] =
= [ ] =
==============================================================
Right Bott OM:
==============================================================
= [ ] =
= [ ] =
= Text [ ] =
==============================================================
中是很容易的:
假设文本的line-height = 10px的,图标高度= 30像素
<div class="container">
Text
</div>
<div class="container right">
Text
</div>
.container {
line-height: 30px;
background: url(...) no-repeat center left
padding-left: 38px;
}
.container.right {
line-height: 30px;
background: url(...) no-repeat center right
padding-right: 38px;
}
的问题是:我该怎么办底部对齐?
'background:url(...)no-repeat right right'? – 2012-08-01 17:41:30