A Cool CSS Navigation Menu
Widgets For Blogger said...
Annie,
Do you have a post or could you make a post about how to make a menu like yours so that when you hover over an image you get an effect like yours?
I have been asked by a couple of people for this, so today I decided to do a little post. First, I want to give all the credit to this wonderful site, Web Designer Wall. I go to that site and get lost in all it's beauty. I just drool over all the cool design features. (Makes for a wet keyboard.) You can read their complete instructions on Advanced CSS Menu.
This is accomplished with a little bit of graphic making and code placing. First with the graphic making. The Web Designer Wall gave great instructions on making your graphics. So, instead of me going over it again, I would suggest reading it there.
That brings us to the code placing. This is a two part process.
1. You will want to place the code in the CSS style sheet. I am showing the the code I used to place the menu in BlogU. That way you can compare with WDW to see any differences, and what the differences do.
/*Roll over feedThe orange: change the values for your own images sizes.
-----------------------------------------------*/
#menu {
list-style: none;
padding: 0;
margin: 0;
width: 500px;
height: 50px;
background: #ffffff;
position: relative;
}
#menu span {
display: none;
position: absolute;
}
#menu a {
display: block;
text-indent: -900%;
position: absolute;
outline: none;
}
#menu a:hover {
background-position: left bottom;
}
#menu a:hover span{
display: block;
}
#menu .home {
width: 144px;
height: 58px;
background: url(home.png) no-repeat;
left: 10px;
top: 25px;
}
#menu .home span {
width: 86px;
height: 14px;
background: url(/home-over.png) no-repeat;
left: 28px;
top: -20px;
}
#menu .about {
width: 131px;
height: 51px;
background: url(about.png) no-repeat;
left: 180px;
top: 18px;
}
#menu .about span {
width: 40px;
height: 12px;
background: url(about-over.png) no-repeat;
left: 44px;
top: 54px;
}
#menu .rss {
width: 112px;
height: 47px;
background: url(RSS.png) no-repeat;
left: 350px;
top: 24px;
}
#menu .rss span {
width: 92px;
height: 20px;
background: url(rss-over.gif) no-repeat;
left: 26px;
top: -20px;
}
The blue: change these values so it fits where you want it. This is simply trial and error...and patience.
The purple: this may have to be changed to fit in your sidebar, depending on the width of your sidebar, or if you put it below your header, that width.
Of course, the style sheet is where you do all of your...ummm...styling, so there may be other changes you want to make.
2. Now you will have to put some code in a widget. Choose HTML/Javascript (my most favorite widget) and put the following code in:
<ul id="menu">The orange: changes here are only to paste your own URL's in the appropriate spot.
<li><a href="YOUR BLOG URL" class="home">Home <span></span></a></li>
<li><a href="YOUR PROFILE URL" class="about">About <span></span></a></li>
<li><a href="YOUR FEED URL" class="rss">RSS <span></span></a></li>
</ul>
Attention Classic Bloggers: Put the widget code in your template between <MainOrArchivePage> and </MainOrArchivePage>. Please note, I haven't actually tested it in Classic, but it looks like it will work fine. Let me know.
That will create the menu. It takes some skill with Photoshop or GIMP, but it is worth the effort!
46 Comments:
Annie,
thanks so much.
I'm sure this post is going to be a great hit amongst your readers!
Really good Comments Disclaimer you got here. what about me Annie, i can comment and come to visit you? ;)
@Avatar, Oh, you know you can comment anytime you please! How have you been? Life good?
That is a daunting disclaimer, isn't it?
Hi Annie,
what a great post, I didnt actually realise you could do this many changes with the blogger templates. Im bookmarking this site for future reference.Lyn From MoneyHomeBiz.com
Wow.. great tutorial. This one is so call. I will test it and see if it will work on my blog. Thanks, keep sending us updates ;0
Hye
I created a similar post to this on how to make an Image Hover Over Effect. So when you hover over an image it changes to another image!
Thanks for sharing this nice code.I found some deference with me.I will correct it from your CSS.Many many thanksagain.
Thanks for the useful tip. It's amazing what you can do with CSS these days. :)
Thanks for sharing this code.I am not a good coder like you but I think your code is really nice.
Waow.. this is nice.. I've been searching for ways to make my website looks more casual than just look rectangle-ly as many or almost all websites have the same look.. this is NICE.. thank you so much.. what a great post...
Thanks for the great post...just found your blog and I'm eager to read more!
Cheers!
You are so kind, normally blogguers don't like to disclose personal stuff as you just did it.
Thanks again ...and keep up making happy the million of bloggers around.
I already apply this nice and cool CSS Navigation Menu.Its really nice.
Here well arranged and varied posts appear again and again. I look gladly here past. Many greetings from the center of Germany!
Thanks. This is great graphics; but a bit over my head. I will continue to read your blog.
@The Mommy and Me Boutique, I started out with simple code and worked my way up. Baby steps!
I thought you might be interested in promoting this! Increase technorati link exchange
Thanks a lot Annie. CSS rocks and i have learned a lot following your guides.
Hi! I find your blog very helpful. Can you please teach me how to post multiple photos in one post? I have a Blogger blog.
Thanks!
hey annie! love your blog and everything you do, this is one of the best ones for blogger hacks, I must say!
I wanted to ask you something about comments..
you know when there are 0 comments, is there a way for it to display something like "no comments" or "post a comment" INSTEAD of it showing "o comments"?
it looks a bit bad!
thanks!
@anonymous, I have a couple of posts that shows how to modify that:
Change "Post a Comment On: " Text
Fixing the '1 ommments' bug in blogger beta
@Hot Momma, I do have that code somewhere, but I have to get on to work now, so I will dig it out later.
I know the right space to place the code in the CSS style sheet.Thanks for sharing.
thanks, Annie for the comment help
found it useful!
CSS has given us a wonderful way to decorate our sites. Thanks for the advice.
Thanks Annie, using it now, looks very cool :D .
Annie, I just used these navigation codes in my blog and I don't see it. May be I used it somewhere. My blog name is journal.
Annie, Never mind I changed the template now.
Thank you.
Priya
Great tutorial. You definitely know your CSS...
This is really nice and I wanted to try this out too but I got stucked at the button making part. The part where we copy merged and paste the button to a new document, duplicate that layer and supposed to erase the strokes in the upper layer. How do you erase them? I tried the eraser tool but it does not budge at all!! We're not supposed to use the eraser tool, are we?
@Wendy Sue, when I did this, I did layers, layers, layers. And yes, I did use the eraser tool, but I only erased on a layer...not the entire image. Made it much easier.
@Wendy Sue, oh...if for some reason the eraser doesn't work...just paint with the background color!
But Annie......
Mine was in layers and layers to. But since the button graphic was transfered to a new doc using copy-merged as per the tutorial, all the layers are merged and transfered to the new doc as one layer. So, there's no 'stroke layer' for me to erase from. :(
Thank you U BLOG, but when I did that My (don't know how to call it)New post/Customize /sign out bar was disappeared. why
@shadowless hope, WOW, that is a new one! I have no earthly idea why the navbar (that is what it is called) disappeared. Puzzling.
Time and again I have found some great contributions from here. Great work. Thanks for sharing everything.
Nice little bit of coding, thanks!!! Check out how I used it for my "home" and "about" button on my
IP Blog
hi annie... i've finally got this cool nav menu... i was so happy that i know have good looking nav but the problem is that i can't add more links to it... have u tried this, too? I wanted to add at least 6 links in the menu but whenever i tried my fourth one, it doesn't work... help?
@Marie, well, I haven't tried that, but I imagine the secret is in adding to the CSS menu correctly. A new category must be created and the 'measurements' must be adjusted. You could change the rss in the below code to what you are adding...like 'contact' and then adjust the width, height, left & top values.
#menu .rss {
width: 112px;
height: 47px;
background: url(RSS.png) no-repeat;
left: 350px;
top: 24px;
}
#menu .rss span {
width: 92px;
height: 20px;
background: url(rss-over.gif) no-repeat;
left: 26px;
top: -20px;
}
Then add this to step 2:
<li><a href="YOUR CONTACT URL" class="contact">Contact <span></span></a></li>
thanks very much
Thanks for sharing these codes...now I can spice up my blog by using these codes in changing my navigation menu...but first thing, I will design a cute graphics menu graphics that I can use...:)anyways thanks for the wonderful ideas you've shared with us!
Hi Annie...
very nice tutorial, I'm looking for tutorials like this since some time ago
Thank you so much for this post. I really like tutorials like this.
Thanks for the tutorial. Simple and it works.
Nice IDea wit the Roll Over Feed. Thx for the Code.
Very clean CSS! A lot of people don't take the time to comment out the sections of their CSS. Of all the rollover methods, I definitely prefer this type of approach.