html - css width on li inline not working -
i'm trying make width of <li>
elements 200px wide seems taking exact width of text.
#m_home_main_links li { display: inline; list-style-type: none; margin: 1%; text-align: center; background-color: orange; color: #198eff; width: 200px; }
<div id="m_home_main_links"> <ul> <a href="/"> <li>mp3</li> </a> <a href="/"> <li>videos</li> </a> <a href="/"> <li>categories</li> </a> </ul> </div>
you need make li
display: inline-block
them respect width setting , still behave inline element:
#m_home_main_links li { display: inline-block; list-style-type: none; margin: 1%; text-align: center; background-color: orange; color: #198eff; width: 200px; }
Comments
Post a Comment