我想垂直對齊中間li
內容但無法做到這一點。垂直對齊中間不與ul李
#leftPanel {
width:25%;
display:table;
}
#leftPanel li {
list-style: none;
margin-bottom: 10px;
width: 100%;
}
#leftPanel li img {
margin-right:10px;
}
.activeBtn, .button5 {
display: table-cell;
float: none;
width: 100%;
background:#ccc;
height: 100%;
vertical-align:middle;
}
<div id="leftPanel">
<ul>
<li>
<a href="#" class="activeBtn"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Location & Sub Location" align="left">Location: Sub Location</a>
</li>
<li>
<a href="#" class="button5"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Issued To" align="left">Issued To</a> \t
</li>
<li>
<a href="#" class="button5"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Non Conformance Standard Items" align="left">Non Conformance Standard items</a>
</li>
<li>
<a href="#" class="button5"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Attendee & Company" align="left">Attendee : Company</a>
</li>
<li>
<a href="#" class="button5"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Construction Calendar" align="left">Construction Calendar</a>
</li>
<li>
<a href="#" class="button5"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Associate Users & Permission" align="left">Associate Users : Permission</a>
</li>
<li>
<a href="#" class="button5"><img src="https://i.stack.imgur.com/yEshb.gif" width="49" height="45" alt="Cost Code Form" align="left">Cost Code</a>
</li>
</ul>
</div>
你是不是也想對準李裏面的內容,或者對準整個鋰左側面板div中? – kauffee000
只嘗試對齊裏面的內容。 – Ezzuddin