/    Sign up×
Community /Pin to ProfileBookmark

cascade menu …continues

Hey programmers,

I’m turning to you again since I’m still stuck with a simple piece of code.
I pasted the code below. Here’s the problem:
The gif images i’m placing as LI items are all the same width, but when I view in browser (ie or firefox), very uneven spaces are created between them. When I place text instead of images the spacings are even. Why is this happening? How can I fix? I tryed so many things. Don’t know what to do anymore 🙁

Thank you very much…

[code]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Untitled Document</title>
<style type = “text/css”>
#nav, #nav ul {
padding: 0;
margin: 0;
list-style: none;
}
#nav a {
display: block;
width: 10em;
}
#nav li {
float: left;
width: 10em;
}
#nav li ul {
position: absolute;
width: 10em;
left: -999em;
}
#nav li:hover ul, #nav li.sfhover ul {
left: auto;
}
</style>

<script language=”javascript”>
sfHover = function() {
var sfEls = document.getElementById(“nav”).getElementsByTagName(“LI”);
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=” sfhover”;
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(” sfhover\b”), “”);
}
}
}
if (window.attachEvent) window.attachEvent(“onload”, sfHover);
</script>

</head>

<body>
<ul id=”nav”>
<li><a href=”#h”><img src=”images/menu_home.gif” border=”0″ width=”151″></a> </li>
<li><a href=”#b”><img src=”images/menu_board.gif” border=”0″ width=”151″></a> </li>
<li><a href=”#p”><img src=”images/menu_programs_on.gif” border=”0″ width=”151″></a>
<ul>
<li><a href=”#”>Climbing perches</a></li>
<li><a href=”#”>Labyrinthfishes</a></li>
<li><a href=”#”>Kissing gouramis</a></li>
<li><a href=”#”>Pike-heads</a></li>
<li><a href=”#”>Giant gouramis</a></li>
</ul>
</li>
<li><a href=”#g”><img src=”images/menu_grant.gif” border=”0″ width=”151″></a>
</li>
</ul>
</body>
</html>
[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @meAsking 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 5.24,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...