Vertical alignment in UL LI?
<ul> <li class="more">aaa</li> <li class="moretwo">aaa</li> <li class="more">aaa</li> </ul> .more { background-color: red; height: 50px; vertical-align:middle; } .moretwo { background-color: green; height: 50px; vertical-align:sub; } Why does vertical alignment not work in this example? Can I do it? If so, how can I do this?
DIRECT EXAMPLE: http://jsfiddle.net/gQM68/ with your answers
+4
4 answers
The vertical-align property applies only to inline-level and table-cell elements. You can get around this limitation by using the span element inside the li element and setting vertical-align to span , for example
<li><span class="more">aaa</span></li> 0