- This topic is empty.
-
AuthorPosts
-
June 10, 2011 at 7:53 am #33070
roncito
Membermade a navbar using images cut out from PS and i cant get it to work? Dont know what im doing wrong. Img size is 469px by 104px. Heres my code.
css:
#nav {background: url(../nav-bar.png)no-repeat ; height: 48px; width: 468px; position: absolute; top: 225px; left: 180px;margin: 0; padding: 0; }
#nav span {
display: none;
}#nav li, #nav a {
height:48px;
display:block;
}#nav li {
float:left;
list-style:none;
display:inline;
}#nav-example-01 {
width: 91px;
}
#nav-example-02 {width: 107px;}
#nav-example-03 {width: 138px;}
#nav-example-04 {width: 126px;}#nav-example-01 a:hover {background: url(../nav-bar.png) 0 -48 no-repeat; }
#nav-example-02 a:hover {background: url(../nav-bar.png) -198px -48px no-repeat; }
#nav-example-03 a:hover {background: url(../nav-bar.png) -336px -48px no-repeat; }
#nav-example-04 a:hover {background: url(../nav-bar.png) -462px -48px no-repeat; }sorry for using all this space and thanks for any help .
ronJune 10, 2011 at 8:08 am #73548roncito
MemberSorry but right now i don’t have it on a server. This is the first time trying this method. any other way to do it? thanks
June 10, 2011 at 8:09 am #73549roncito
Memberalso the imiage that im using is a png24, its tranparent. i dont know if that makes a difference either?
RonJune 10, 2011 at 8:20 am #73524roncito
MemberJune 10, 2011 at 8:53 am #73526chrisburton
Participant…You absolutely do not need an image for this.
June 10, 2011 at 3:34 pm #73411roncito
Memberthanks for the suggestion,
I’ll give it a try.
RonJune 10, 2011 at 3:37 pm #73413TheDoc
Member@fordinary
page-id-7 #nav li.Projects a {
/* shift background position */
}June 10, 2011 at 5:22 pm #73398TheDoc
MemberYou’d have to do this:
background-position: 0 -47px;June 10, 2011 at 6:26 pm #73382TheDoc
MemberOops! You’re missing the . in front of page-id-5.
.page-id-5 #nav li.About-Me a
June 11, 2011 at 2:02 am #73341furrball1383
Memberdude i agree with Christopher Burton, you do not need an image for this, simply have your font styles set up for your list items and then have the onhover and onclick commands set the colors of said list items to the new colors
June 11, 2011 at 8:18 am #73338chrisburton
Participantif that is what roncito is after then the image sprite is the best method to be using
False. In no way do you need to use an image to change color and use an underline on a hover event.
June 11, 2011 at 9:46 am #73335chrisburton
Participant@sl1dr: I completely understood your point but I believe it is naive and unless his graphic was significant enough not able to produce through code, I would certainly not use an image. There are other ways to help with fallback.
June 13, 2011 at 5:20 pm #73129roncito
Memberthanks guys for the help. it works either way for me.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.