html - Arrow menu and line-height -
i've got problem menu, work great, i've got longer menu item names, , messing layout. can help, i've run out of ideas.
html
<ul> <li><a href="#">foobar</a></li> <li class="active"><a href="#">foobar</a></li> <li><a href="http://line25.com/tutorials/how-to-create-flat-style-breadcrumb-links-with-css">foobar longer</a></li> <li><a href="#">foobar</a></li> <li><a href="#">foobar</a></li> </ul>
css
ul { margin: 20px 60px; } ul li { display: inline-block; height: 60px; line-height: 60px; width: 100px; margin: 15px 10px 0 0; text-indent: 35px; position: relative; } ul li:before { content: " "; height: 0; width: 0; position: absolute; left: -2px; border-style: solid; border-width: 30px 0 30px 30px; border-color: transparent transparent transparent #fff; z-index: 0; } ul li:first-child:before { border-color: transparent; } ul li a:after { content: " "; height: 0; width: 0; position: absolute; right: -30px; border-style: solid; border-width: 30px 0 30px 30px; border-color: transparent transparent transparent #ccc; z-index: 10; } ul li.active { background: #2e6ab3; z-index: 100; } ul li.active a:after { border-left-color: #2e6ab3; } ul li { display: block; background: #ccc; } ul li a:hover { background: pink; } ul li a:hover:after { border-color: transparent transparent transparent pink; }
here fiddle.
the problem line-height not text, coloured background well. want make line-height smaller, fit base height, , background base height.
thanks, mani
use min-width
in li
, height
in ul
: https://jsfiddle.net/ilpo/ksnr3/1793/
Comments
Post a Comment