我正在尝试使用最少的 css 元素在 css 中实现以下对齐:
中间:
==============================================================
= [icon] =
= [ ] Text =
= [ ] =
==============================================================
底部:
==============================================================
= [icon] =
= [ ] =
= [ ] Text =
==============================================================
右中:
==============================================================
= [ ] =
= Text [ ] =
= [ ] =
==============================================================
右下角:
==============================================================
= [ ] =
= [ ] =
= Text [ ] =
==============================================================
中间真的很容易:
假设文本行高 = 10px,图标高度 = 30px
<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;
}
问题是:如何进行底部对齐?