/    Sign up×
Community /Pin to ProfileBookmark

I’m trying to figure out the positioning to do a image roller but after a hour I can’t get it.

For some reason it’s only detcting the “portfolio” link.

HTML:

[CODE]
<body>

<div id=”navigation”>

<ul id=”navmenu”>
<li id=”home”><a href=”index.html” title=”Home”></a></li>
<li id=”services”><a href=”services.html” title=”Services”></a></li>
<li id=”portfolio”><a href=”portfolio.html” title=”Portfolio”></a></li>
</ul>

</div>
</body>
[/CODE]

CSS:

[CODE]
@charset “utf-8”;
/* CSS Document */

a:link {
color:#CC0000;
font-weight:bold;
text-decoration:none;
}

a:hover {
text-decoration:underline;
}
a:visited {
color:#CC0000;
font-weight:normal;
text-decoration:none;
}

div#navigation {
margin: 4px;

}
ul#navmenu {
width:125px;
height:125px;
margin:0;
padding:0;
background:url(menu.jpg) no-repeat;
position:relative;
}
#navmenu li {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 0;
}
#navmenu li,#navmenu a {
height: 125px;
display: block;
}
img {
border:none;
}
#navmenu a{
text-decoration:none;
}
#navmenu a i {
visibility: hidden;
}

#home {top: 0; width: 125px; height:43px;}
#services {top:-43px; width: 125px; height:43px;}
#portfolio {top: -86px; width: 125px; height:43px;}

#home a:hover,#home a:active {
background:transparent url(menu.jpg) 900px -113px no-repeat;
}
#services a:hover,#services a:active {
background:url(menu.jpg) -131px 0px no-repeat;
}
#portfolio a:hover,#portfolio a:active {
background:url(menu.jpg) -131px 0 no-repeat;
}

[/CODE]

Thanks in advance

[upl-file uuid=29e0414c-8cd6-438e-b852-90035c1e8988 size=48kB]menu.jpg[/upl-file]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@CentauriJul 11.2008 — The background image should be applied to the <a> elements, and the <a>s sized to only show one. If the id's are moved to the <a> tags :[CODE] <div id="navigation">

<ul id="navmenu">
<li><a href="index.html" title="Home" id="home"></a></li>
<li><a href="services.html" title="Services" id="services"></a></li>
<li><a href="portfolio.html" title="Portfolio" id="portfolio"></a></li>
</ul>

</div>
[/CODE]

Then the css can be :[CODE]ul#navmenu {
width:126px;
height:125px;
margin:0;
padding:0;
}
#navmenu li {
margin: 0 0 7px;
padding: 0;
list-style: none;
}
#navmenu a {
height: 37px;
display: block;
}
img {
border:none;
}
#navmenu a{
text-decoration:none;
background-image: url(menu.jpg);
background-repeat: no-repeat;
}
#home {
background-position: left top;
}
#services {
background-position: left center;
}
#portfolio {
background-position: left bottom;
}
#home:hover, #home:active {
background-position: -131px top;
}
#services:hover, #services:active {
background-position: -131px center;
}
#portfolio:hover, #portfolio:active {
background-position: -131px bottom;
}
[/CODE]
×

Success!

Help @mikegreenia_com 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,
)...