/    Sign up×
Community /Pin to ProfileBookmark

hi, im doing a simple <ul>. the problem is the spacing between the <li> looks fine in firefox and opera, but not in IE. The top and bottom spacing is alot. Anyone knows how to fix this?

here is my code:

index.html

[code=html]<html>
<head>
<title></title>
<link type=”text/css” rel=”stylesheet” href=”style.css” />
</head>
<body>
<h3>Options</h3>
<div id=”sidebar1″>
<ul>
<li><a href=”” class=”nav1″>text1</a></li>
<li><a href=”” class=”nav1″>text2</a></li>
<li><a href=”” class=”nav1″>text3</a></li>
<li><a href=”” class=”nav1″>text4</a></li>
<li><a href=”” class=”nav1″>text5</a></li>
</ul>
</div>
</body>
</html>[/code]

style:

[CODE]#sidebar1{
float: left;
width: 270px;
clear: left;
margin: 0 0 2em 0;
}

#sidebar1 ul{
list-style: none;
padding: 0;
margin: 0
}

#sidebar1 li{
list-style: none;
padding: 0;
margin: 0
}

#sidebar1 a{
display: block;
border-bottom: 1px solid #d6d8d9;
padding: 2px 10px 2px 10px;
font-size: 12px;
font-weight: bold;
text-decoration: none;
}

a.nav1:link,a.nav1:active,a.nav1:visited{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:600;
color: #ee3576;
text-decoration:none;
}

a.nav1:hover{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:600;
color: #ee3576;
text-decoration:underline;
}
[/CODE]

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@tracknutMay 04.2008 — If you set a line-height on your <li> CSS, you can make them the same. For whatever reason, the default line height is apparently different on the two browsers.

Dave
Copy linkTweet thisAlerts:
@CentauriMay 04.2008 — This quite often happens in IE when the <a>s are set to block display but not assigned a width. Setting a width fixes it up :[CODE]#sidebar1 a{
display: block;
border-bottom: 1px solid #d6d8d9;
padding: 2px 10px 2px 10px;
font-size: 12px;
font-weight: bold;
text-decoration: none;
[COLOR="Red"]width: 250px;[/COLOR]
}[/CODE]
×

Success!

Help @nuttynibbles spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...