- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am learning CSS (and thanks Chris for this wonderful website, with so much great info!).
I am trying to use Sprites for a Nav Menu, but they are stacking on top of each other instead of going horizontal. I’ve been trying to solve this myself, but I don’t know enough to know what I’m doing wrong. Could someone help? the URL is http://newsalescoach.dreamhosters.com
Thanks for helping a Newbie!
.custom #myheader-right a
Float this to the left and assign a width – finito! You’ll probably have to make the myheader-right div wider, too.
OK, you have your li
‘s set to display: inline
, but in order to give the a
‘s a background image, you have them display: block
, which means they each get their own line. Instead of using display: inline
, try floating the a
‘s and li
‘s, either right or left, then they’ll line up next to each other. Next, you have to set the width on the a’s since there’s no text there to make sure the element is wide enough to show the whole sprite, and you need to make sure that #myheader-right
is wide enough for them all to be next to each other.
And just a note: it’s generally frowned upon to use id’s like myheader-right, since that is describing what it should look like rather than what its contents are. Try, I dunno, #nav and #navContainer or something. Although, that #myheader-right div is kind of unnecessary, right? You can just put those styles on ul#nav-right instead.
Good luck!
And Doc beat me to the punch. I took too long to type that…
You are wonderful! Thanks for your help. I’m going to try these changes right away… (and thanks for the bonus info about naming the ids — that’s exactly the stuff I would never know myself!)
Thanks Again Guys — your instructions were perfect and the menu works perfectly now! Yippee.
Really appreciate your help!