Jump to content

Problem With Css In Ul List


Dark Knight

Recommended Posts

<div>				<ul id="list">					<li><a href="http://www.link.com">First link</a></li>					<li><a href="http://www.link.com">Second link</a></li>					<li><a href="http://www.link.com">Third link</a></li>				</ul></div>

#list {	background-color: #044;	font-size: 9pt;	color: #066;	padding: 0px;	margin: 0px;}#list li {	margin-left: 25px;	list-style-type: disc;	color: silver;}#list a, #list a:visited {	display: block;	font-size: 9pt;	color: #099;	text-decoration: none;}#list a:hover {	text-decoration: underline;}

Why the code above is not working in IE 6? In FF, the list has no distance between what is in the list. What's the problem?

Link to comment
Share on other sites

The scientist might be correct, the browser gives <li> elements default padding and margin. If I were you I would reset all padding and margin on those elements and work backwards.P.S. browsers don't always know how to interpret pt unit measurements. pt is generally reserved for print, try px (pixels) or better yet em which will render your type relative to it's parent default em size.

Link to comment
Share on other sites

its how IE applies padding, margins and sizing of disc, try below<style type="text/css">#list { background-color: #044; color: #066;padding-left:25px;margin:0;/*IE6*/}#list li {list-style-type: disc;font-size: 12px; /*control disc size, controls spacing of li height for IE6*/color: silver;line-height:8px; /*IE6*/margin-left:25px;}#list a, #list a:visited { display: block; color: #099; text-decoration: none; font-size: 12px; line-height:14px!important; height:15px!important; line-height:9px;/*IE6*/ height:9px;/*IE6*/}#list a:hover { text-decoration: underline;}</style>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...