html - Vertical align multiple lines break out -
i want vertically align text in links :
the whole block links, , same size. tried set line-height height of container center , reset line-height span defined line-height inside link didn't work :
here's code :
<section class="faq"> <nav> <ul class="nav nav--stacked"> <li><a href=""><span>où est la bulle à verre la plus proche ?</span></a></li> <li><a href=""><span>quand sont les ramassages ?</span></a></li> <li><a href=""><span>x</span></a></li> <li><a href=""><span>x</span></a></li> <li><a href=""><span>x</span></a></li> </ul> </nav> </section>
and css:
.faq { display: block; padding: 15px; height: 100px; line-height: 100px; padding-left: 90px; background: #f2f2f2; color: #bdbdbd; text-transform: uppercase; margin-bottom: 10px; font-size: 13px; } .faq span { line-height: 1.7; }
tried "table-cell" way, didn't work. also, if of have cleaner solution, awesome , appreciated !
i think need change:
.faq { display: block; padding: 15px; height: 100px; /*line-height: 100px;*/ <---- remove padding-left: 90px; background: #f2f2f2; color: #bdbdbd; text-transform: uppercase; /*margin-bottom: 10px;*/ <--- delete font-size: 13px; } .nav--stacked > li { display: list-item; margin-bottom: 20px; } .nav--stacked > li > { display: table-cell; vertical-align: middle; width: 237px; }
Comments
Post a Comment