现在我有这个:
HTML:
<li class="sidebar-menu-item">
<p class="sidebar-menu-button" ><img src="img/logout.png"/>Text that could be very long</p>
</li>
我想要的是什么:
非常感谢任何帮助:)
答案 0 :(得分:4)
在父级上使用flex
,在align-items: center
上使用li {
list-style: none;
}
li p {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
垂直对齐父级。
<li class="sidebar-menu-item">
<p class="sidebar-menu-button">Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br>Text that could be very long<br><img src="http://kenwheeler.github.io/slick/img/lazyfonz2.png"/></p>
</li>
&#13;
android...Toolbar
&#13;