12
09
2008
Unnecessary margins in list’s elements in Internet Explorer
Posted by: raph in Webmastering, tags: cssLet’s assume we want to create a menu using code like that:
<div id="menu"> <ul> <li><a>link1</a></li> <li><a>link2</a></li> <li><a>link3</a></li> </ul> </div>
and we will use CSS like that:
#menu li a{
border-color: #AEAEAE #AEAEAE #AEAEAE #8CCE20;
border-width: 0 1px 1px 0;
border-style: solid;
color: #1F2024;
display: block;
font-family: Verdana;
font-size: .775em;
height: 14px;
padding: 10px 0 8px 13px;
text-decoration: none;
}
Internet Explorer will add unnecessary space beetween each list’s element, so i.e. frame borders could be discontinued. The solution is to add this line:
vertical-align: bottom;
to “#menu li a”.
Source: http://phonophunk.com/articles/ie-fix-for-gaps-between-list-items.php
Entries (RSS)