css - Varying lengh of link text in menu links makes links unequal height -


i making menu links have varying lengths of link text. makes links wrap onto 2 lines , others not.

in image below red area link , clickable, grey area not. code first example , need create 2nd:

enter image description here

<ul>   <li>     <a href="#">link 1</a>   </li>    <li>     <a href="#">link 2 has very long text</a>   </li>    <li>     <a href="#">link 3</a>   </li> </ul>  ul {   padding: 0;   margin: 0;   display: table;   width: 400px;   border: 1px solid black; } li {    list-style-type: none;    display: table-cell;    background: grey;    width: 33%; } {   background: red;   width: 100%;   display: inline-block;   height: 100%; } 

http://codepen.io/anon/pen/gcaem/

this fiddle works.

css

ul {   padding: 0;   margin: 0;   display: table;   width: 400px;   border: 0px solid black; } li {    list-style-type: none;    display: table-cell;    background-color: transparent;    margin-left: 5px;    border: 5px solid white;    width: 33%;    height: 75px;    text-align: center;    border: 1px solid gray; } {   display: table;   background-color: red;   color: white;   width: 100%;   height: 100%;   text-align: center;   text-decoration: none; } span {     display: table-cell;     height: 100%;     width: 100%;     text-align: center;     vertical-align: middle;  } 

this result in firefox:

enter image description here


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -