【发布时间】:2016-06-01 15:49:32
【问题描述】:
我需要将li 的内容垂直居中,所以我所做的是lineheight,它可以工作,但问题是当我有多行时,这种技术不再有效,我can't modify@ 987654324@,因为这是教授给出的约束。所以我真的用完了解决方案。
这是HTML 和Css
li
{
list-style-type:none;
border-bottom: 1px solid #e0e0e0;
height: 55px;
display: inline-block;
vertical-align: middle;
width: 100%;
line-height: 55px;
}
ul
{
list-style : none;
}
<ul>
<li>
The 2015–16 UEFA Champions League was the 61st season of Europe's premier club football tournament organised by UEFA, and the 24th season since it was renamed from the European Champion Clubs' Cup to the UEFA Champions League
</li>
</ul>
【问题讨论】:
-
垂直对齐方式?
-
是垂直对齐
-
您必须使用其他 4 或 5 种技术中的一种来垂直居中您的内容。关于 SO 的许多问题都很好地涵盖了它们。