CSS Rollover Menu Tutorial

  • November 24th, 2008

Hello everyone, I am sure you all know what a CSS Rollover Menu is but do you know how to hand code one yourself? Most do not and they use a auto program but what they don’t understand is that those programs often times code for older standards and or have messed up coding and people don’t know how to hand correct those problems for a working menu.

With that said today you can remove those auto programs from your computer because I am going to show you how to hand code the CSS Rollover Menu from scratch! If you don’t want to read this how-to and would rather just get a working menu that you can mess with, at the end of this tutorial is a place you can download the work files for this tutorial and experiment with them on your own, however I suggest you read this tutorial if you really want to learn! Its not that hard and you will thank yourself later on!

Tutorial Name: CSS Rollover Menu
Software Needed: Notepad But I recommend the free Edit Pad Pro program myself!
Skill Level: Basic HTML / CSS

To start you will need to know some basic HTML, nothing to advanced here but we want to create a basic bullets list and ensure the text from each bullet is linked to a page. If you don’t have one ready or if you just want to use ours for sake of example just copy and paste this code between the and tags of your page.

<li><a href="http://www.urldemo1.com">Menu Item Name1</a></li>
<li><a href="http://www.urldemo2.com">Menu Item Name2</a></li>
<li><a href="http://www.urldemo3.com">Menu Item Name3</a></li>
<li><a href="http://www.urldemo4.com">Menu Item Name4</a>

You will notice I left of the UL tag around these LI tags. I did this on purpose and if you add the UL tag after we complete this tutorial you will understand why I did this!

Now that you have your bullet list created its time to define a CSS class for them! Lets start by creating a <li class=""></li> tag around the whole code. We will name the CSS Div Class “rollOverColor”, the code should look like this!

<li class="rollOverColor"><a href="http://www.urldemo1.com">Menu Item Name1</a></li>
<li class="rollOverColor"><a href="http://www.urldemo2.com">Menu Item Name2</a></li>
<li class="rollOverColor"><a href="http://www.urldemo3.com">Menu Item Name3</a></li>
<li class="rollOverColor"><a href="http://www.urldemo4.com">Menu Item Name4</a></li>

You may be wondering what this div class will do, well basically we are going to use it as the background around our menu items. I mean we want our menu to have a specific background color right? We also want the menu to have a specific width to it, this div class will do both jobs nicely.

Now that we have our css class made its time to actually write the css for our page. I am assuming you will be placing your css in an html page or into a cms systems theme. However you do it make sure you call the stylesheet somehow. I use the following line to call mine…

<link href="/css/roll-over.css" rel="stylesheet" type="text/css" media="all">

Now thats all fine and dandy but what do we actually have in our roll-over.css file to make the actual roll over menu? Glad you asked, lets break it down!

Here is what is in the roll-over.css file…

.rollOverColor a:link, li { color: #006bb5; font-family: arial; font-weight: bold; background-color: #e4eeee; text-decoration: none; text-align: center; width: 200px; height: 25px; list-style-type: none; }

.rollOverColor a:hover { color: #302f2a; font-family: arial; font-weight: bold; background-color: #eae9e1; text-decoration: none; text-align: center; width: 200px; height: 25px; list-style-type: none; }

We have esentially created two css classes in our css file. The first one deals with the roll over menu background color, the font type and the black bullet all at the same time.

I won’t get into to much detail here as you can copy and past what is above and then tweak how you like it. The most important thing to remember here is that the CSS is pretty basic and if you import the style sheet to dreamweaver or any other css editor you will easily be able to edit these real time in a wysiwyg editor!

I hope this tutorial has proved useful to you and I hope you now know the basics to a roll over menu!

Here is the source files if you want to grab them, enjoy!

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • Furl
  • MisterWong
  • Propeller
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati

Comments on “CSS Rollover Menu Tutorial”

Jenn Air Stoves said:

shares use a superb webpage decent Gives bless you for the work to help me

deep wrinkle serum said:

I feel lucky to visit your site.

Trance Music said:

Going to see Roger Shah Tonight. Its gonna be really good. There playing with Eddie Halliwell. Then next week ill be seeing Dirty South. stunning nights ahead

live webcam chat said:

Hi, admin, I like your blog, but how can I subscribe to the blog itself?

Garden Canopies said:

I notice quite a number of sites which appear intriguing and really worth a read. There’s nothing worse than searching through countless blah blah blogs just to find a couple which hold your attention. Thanks. Great job!

Amber Light Bar said:

That’s right! Great writing, continue to keep in place the terrific work. This is the kind of knowledge that really should get worldwide recognition for it’s craft. More authors ought to learn from you. This is actually precisely on the money.

Dairy Equipment said:

Useful tips discussed I am really pleased to read this particular write-up..thanks with regard to presenting people nice info.Fantastic walk-through. I appreciate this article.

Emergency Vehicle Lights said:

Certainly agree with just what you stated. Your explanation was undoubtedly the easiest to comprehend. I tell you, I usually get irked when people comment on issues that these people obviously do not know about. You were able to hit the nail on the head and spelled out everything with out problem. Perhaps, folks could take a sign. Will more than likely be back again to obtain more. Thx

Iron Railings said:

Definitely concur with just what you stated. Your explanation was certainly the least complicated to fully grasp. I usually get annoyed any time folks comment on factors that these people plainly don’t know about. You managed to strike the nail on the head and spelled out every thing with out problem. Perhaps, individuals can take a signal. Will more than likely be back again to get even more. Thanks

satellite dish tripod said:

Just happened upon your article and will have a look at additional ones. Looks like seriously great stuff.

Snow Cone Syrup said:

Fantastic information. Wish i could get more knowledge like this from others! Thanks!

Sugar Free Syrup said:

Helpful information provided I’m really happy to see this particular article..many thanks with regard to presenting us great info.Excellent walk-through. I truly appreciate this blog post.

Mini Light Bar said:

Definitely agree with just what you stated. Your explanation was undoubtedly the least complicated to comprehend. I usually get irked when individuals comment on issues that these people plainly do not know about. You managed to strike the nail on the head and explained the whole thing with out problem. Maybe, people could get a signal. Will more than likely be back again to acquire even more. Cheers

Casters Wheels said:

I see quite a few blogs that appear interesting and worth a read. There is absolutely nothing worse than sifting through endless yada yada sites simply to locate a few which hold ones interest. Many thanks. Great job!

Capsule Machine said:

I like your layout, the fact that your webpage is a little bit unique helps make it so useful, I get fed up of seeing the same stuff just about all almost daily. I have I just happened on this web page by you Many thanks.

Sealing Machine said:

I enjoy your design and style, the particular inescapable fact that your webpage is actually a tad bit unique tends to make it so useful, I get tired of discovering the same stuff almost all almost daily. I’ve I just happened on this page by you Thank you.

Sealing Machines said:

I like this site. Very practical and very motivational. Thanks a ton. It’ll help me a lot.

birthday supplies said:

Good blog! I truly love how it’s easy on my eyes and also the info are well written. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your rss feed which ought to do the trick! Have a nice day!

hypotheek said:

Hoeveel kan ik lenen? (hypotheek). Wat worden mijn maandlasten? (hypotheek) … Hoeveel hypotheek heb ik nodig? Hoe hoog is de boete die ik nu zou moeten

Toxic Chinese Drywall said:

thanks for the illuminating piece of writing. I was initially delighted once i examined your current article and now have made an important membership to it. You need to up-date this post when you’re able to as I would really like more information.

cincinnati's best chiropractic said:

Incredible to enjoy finally look at this post. I replied to your previous post although I didn’t have a answer.Is this kind of theme a standard web template or possibly perhaps you have customised your webblog Thank you.

casa tua gastronomia panama said:

It is nice to definitely dig up a blog where the blogger is logical. Thanks for creating your website.

good blog said:

Very good article and blog, poker is good to !

lenen said:

Lenen zonder BKR toetsing gaat vandaag heel gemakkelijk. Binnen een paar uur geld lenen zonder BKR toetsing doet u hier, lees snel verder

Progressive Trance said:

I apologize for the possible off-topic Guys, but could you inform me which web hosting company you are using right now I have a problem because my current web hosting company godaddy.com is kicking me off. They say that our website is using too many server resources. But our website only gets 400 visitors per week. Anyway, what would be your recommendations? Are you happy with your web hosting company? I am checking LCN at the moment, but is it real that they can provide unlimited disk space? I have contacted them and they say something like 1000GB disk drive costs only $50 per month, so if some day we will start running out of disk space we will simply add a new 2000gb drive so can continue updating.. What do you think about it? Any ideas and web host name suggestions are much appreciated.

lenen zonder bkr toetsing said:

Lenen zonder BKR toetsing gaat vandaag heel gemakkelijk. Binnen een paar uur geld lenen zonder BKR toetsing doet u hier, lees snel verder

Sealing Machine said:

I like your layout, the particular inescapable fact that your webpage is a little bit distinctive tends to make it so fascinating, I get completely fed up of seeing same-old-same-old all of the time. I’ve I merely stumbled on this site by you Appreciate it.

cash advance said:

Heyy, Found your blog on Bing and I am so glad I did! Keep it up!

free online articles said:

I am tired of these money making rackets. What I do is, publish my articles to article sites to get my web traffic.

Dorethea Bickleman said:

Towards the end of the event several people came up and made a point of telling me, that my initial introduction was wrong and that I was really a nice guy. And some of those people still talk to me today, so I take it they weren’t lying.

PowWeb Review said:

Thank you for this post, It’s a fantastic read which was extremely helpful.

Trance said:

Im sorry for the possible off-topic Guys, but could you inform me which web host you are using right now I have a problem because my current web hosting company hostrator.com is kicking me off. They say that our website is using too many server resources. But our website only gets 200 visitors per week. Anyway, what would be your recommendations? Are you happy with your web hosting company? I am checking LCN at the moment, but is it real that they can provide unlimited disk space? I have contacted them and they say something like 2tb disk drive costs only $50 per month, so if some day we will start running out of disk space we will simply add a new 1000GB drive so can continue updating.. Whats your opinion? Any ideas and web hosting company name suggestions are much appreciated.

Trance said:

I apologize for the possible off-topic Guys, but could you inform me which web host you are using right now I have a problem because my current web hosting company bluehost.com is kicking me off. They say that our website is using too many server resources. But our website only gets 200 visitors per week. Anyway, what would be your recommendations? Are you happy with your web hosting company? I am checking LCN at the moment, but is it real that they can provide unlimited disk space? I have contacted them and they say something like 1000GB disk drive costs only $20 per month, so if some day we will start running out of disk space we will simply add a new 2000gb drive so can continue uploading.. What do you think about it? Any ideas and web hosting company name suggestions are much appreciated.

iphone for free said:

Hi, Thanks for the chance to blog post here as it again surpasses phoning! My group is really impressed by the contribution other blog writers are generating with your blog and aspire to chip in too any time i can. I agree with the particular earlier poster and desire to return once in a while.

Emergency Vehicle Lights said:

What theme are you utilizing here ? I really like the layout. Thanks for this posting.

car disposal said:

Hi, admin, I like your blog, but how can I subscribe to the blog itself?

Amber Light Bar said:

I see really quite a few sites that appear intriguing and really worth a read. There’s nothing worse than browsing through countless yada yada blogs simply to find a couple which hold ones attention. Many thanks. Good job!

Dairy Equipment said:

I see quite a few blogs that look interesting and worth a read. There is nothing worse than sifting through limitless yada yada sites simply to locate a few that keep your attention. Many thanks. Great job!

Emergency Vehicle Lights said:

Very good resources. Wish I could locate more info like this by other people! Thank you!

Garden Canopies said:

Certainly agree with what you stated. Your explanation was undoubtedly the least complicated to comprehend. I tell you, I usually get irked when folks discuss factors that these people plainly do not know about. You were able to strike the nail on the head and spelled out everything without complication. Maybe, folks could get a sign. Will likely be back to acquire more. Many thanks

Iron Railings said:

I see really quite a number of sites that appear interesting and really worth a read. There is absolutely nothing worse than browsing through countless yada yada blogs just to locate a couple which keep your attention. Many thanks. Great work!

Mini Light Bar said:

Home made whipped cream! Great piece, continue to keep in place the terrific work. This is the sort of knowledge that really should get worldwide recognition for it’s workmanship. Far more writers ought to learn from you. This is actually precisely on the money.

personal security alarms said:

Useful tips shared I’m very delighted to read this particular article..thanks for providing people nice info.Great walk-through. I truly appreciate this article.

preparedness kits said:

Useful info discussed I am very delighted to go through this particular write-up..many thanks with regard to giving all of us great material.Excellent walk-through. I appreciate this kind of post.

satellite dish tripod said:

What theme are you utilizing here ? I like the design. Thanks for the posting.

Snow Cone Syrup said:

Great information. Wish i could get more information like this by others! Thank you!

Sugar Free Syrup said:

Just stumbled upon your article and will certainly check out additional ones. Looks like real great stuff.

survival supplies said:

I see really quite a few sites which appear intriguing and worth a read. There probably is absolutely nothing worse than sifting through limitless blah blah sites simply to find a few that hold ones attention. Thanks. Great job!

survival saw said:

Yes! Fantastic writing, continue to keep up the terrific job. This is the kind of information that really should get acknowledgement pertaining to it’s craft. More authors need to learn from you. This is actually right on the money.

Blast Cabinet said:

Took me a moment to be able to understand most the remarks, but I really appreciated the article. It turned out to be Very valuable to me personally and I am confident to almost all the commenters here! It’s definitely great when a person can not only be enlightened, but additionally entertained! I’m sure you had fun writing this kind of post.

Boxes And Packaging said:

Just came upon your post and definitely will have a look at other ones. Seems like seriously good stuff.

Capsule Machine said:

Absolutely concur with exactly what you said. Your explanation was definitely the least complicated to understand. I generally get irked any time individuals comment on issues that these people plainly don’t know about. You were able to strike the nail on the head and explained the whole thing with out problem. Maybe, individuals could get a signal. Will more than likely be back to get more. Appreciate it

Casters Wheels said:

Fantastic resources. Wish I could find more info like this from others! Many thanks!

Display Boxes said:

What theme are you utilizing on your site ? I like the style. Many thanks for this posting.

Hand Truck Wheels said:

I notice really quite a few sites that look intriguing and really worth a read. There is absolutely nothing worse than searching through countless blah blah sites just to locate a few which hold your interest. Thanks. Great job!

Jewelry Display Supplies said:

Home made whipped cream! Great writing, keep in place the terrific job. This is the type of info that really should gain worldwide recognition pertaining to it’s craft. More writers ought to learn from you. This is actually precisely on the money.

Metal Cutting Tools said:

Definitely agree with just what you said. Your explanation was undoubtedly the simplest to understand. I typically get irked whenever folks discuss factors that they plainly don’t know about. You were able to strike the nail on the head and explained the whole thing without problem. Maybe, individuals can get a signal. Will likely be back again to get a great deal more. Appreciate it

Sealing Machine said:

Helpful information discussed I am quite pleased to see this particular article..many thanks for giving people great material.Excellent walk-through. I appreciate this kind of article.

Sealing Machines said:

Home made whipped cream! Great piece, keep in place the awesome work. This is the sort of material that ought to get worldwide recognition for it’s craft. More internet writers need to learn from you. This is precisely on the money.

Xenon Bulb said:

Great info, many thanks to the writer. This is perplexing to me right now, but all around, the efficacy and significance is mind-boggling. Very much thanks once again and best of luck!

Canal Panama said:

Me English no well, but had to say me like what you say. Thank you from me. Me share video now of my country.

Rebuld Credit After Bankruptcy said:

Just came upon your post and will certainly check out additional ones. Looks like seriously great stuff.

Renting After Bankruptcy said:

Took me time to examine most the feedback, but I truly enjoyed the article. It proved to be Very valuable to me and I am sure to all the commenters here as well! It is definitely nice when you can not merely be informed, but also entertained! I’m sure you had fun creating this article.

Artificial Cactus said:

Yeah! Excellent writing, continue to keep up the amazing job. This is the kind of knowledge that should gain worldwide recognition for it’s workmanship. Far more authors should learn from you. This is precisely on the money.

Cardboard Packaging said:

Just came upon your article and will certainly have a look at other ones. Looks like real good stuff.

Inkjet Labels said:

Helpful tips discussed I’m really pleased to see this particular write-up..thanks with regard to providing all of us great tips.Great walk-through. I enjoy this kind of write-up.

Mylar Balloon said:

Just happened upon your post and definitely will review other ones. Looks like real great stuff.

Platform Wedge said:

Certainly concur with what you explained. Your explanation was certainly the simplest to fully grasp. I typically get annoyed any time individuals comment on factors that they obviously do not know about. You managed to hit the nail on the head and explained every thing without problem. Perhaps, individuals can take a signal. Will more than likely be back to acquire even more. Many thanks

submit articles free said:

I have had tons of success publishing my articles to article directories. You can simply triple traffic.

Janett Haltom said:

Hello could I quote some of the material found in this post if I link back to you?

marketing internet strategy said:

I would like more people would generate posts this way that can be entertaining you just read. With all the current nonsense floating around over the internet, it truly is rare to read a weblog like this instead

Clinton Machalek said:

Hello, I stumbled across this page by mistake when I was exploring on Google then I wandered on your page. I’m compelled to tell you that your internet site is massively cool I really like your theme! Appropriate now I’ve a good deal of totally free time to go through your weblog so I saved. I is going to be back soon. Kudos for the fantastic web site.

essay writing service said:

Good day, I’d personally also like to mention that my partner and i like your way of writing. It’s easy to realize the reason why you get countless feed-back on your own web page. in any case great job with your amazing site.

Sirena Maruscak said:

Slick blog post, I seriously enjoy your position of watch. You always are in agreement with how I feel.

salem lawrence mls said:

Wonderful learn, I simply passed this onto a colleague who was in search of this info. I’ve you bookmarked on Digg.

austin sell home said:

Thanks for posting and sharing with all – Cheers

spokane help you sell said:

I had difficulty looking at this in Firefox but it works fine in IE. Anway, the content is good. I am very happy to have come across this.

indianapolis fsbo said:

This article gives the light in which we can observe the reality. this is very nice one and gives indepth information.

Jesse Jitchaku said:

I agree with a lot of what you’re saying here but it could do with more detail. – Money is better than poverty, if only for financial reasons. – Woody Allen Born 1935

rockford cheap mls said:

This really is my very first time i visit here. I discovered so numerous fascinating stuff in your weblog particularly its discussion. From the plenty of comments on your content articles, I guess I am not the only one having all the enjoyment right here! keep up the great work.

Jose Jerden said:

This is a good approach to what, for some, may be a controversial topic. Very well though out post. – I’m not afraid to die. I just don’t want to be there when it happens. – Woody Allen Born 1935

Download mp3 said:

I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks – you cleared up some things for me!

yourhostfiles said:

Nice post. i learned many more about the football from this post.thanks for posting.

wichita for sale by owner said:

Great, I have already bookmarked your this page…Now I don’t have enough time for read but by reading beginning part I must say…it was a positive start .. Would love to read further too…Thanks for great post!

SEO Tips said:

Lol, my uncle placed this article on his favorites (we share the same comp). Looks cool, keep working!

Jonathan Joly said:

This is a good approach to what, for some, may be a controversial topic. Very well though out post. – There’s always one more bug. Attributed to Lubarsky’s Law of Cybernetic Entomology

John Josephs said:

Interesting point of view.Thanks for the post. – The value of a program is proportional to the weight of its output. Attributed to Laws of Computer Programming

migraine said:

Migraine is hoofdpijn die in aanvallen komt. De hoofdpijn komt plotseling op, soms midden in de nacht zodat u er wakker van wordt. De pijn zit meestal aan

Nicolle Gobrecht said:

You’re not the typical writer, man. You surely have something strong to add for the net. Your theme is so strong that you could virtually get away with being a bad writer, but youre even wonderful at expressing what you have to express. Such a excellent blog. I’ll be back for more.

Letting Agents Cardiff said:

Spotted a link to this post over at Stumbleupon. Thanks for posting it. I’m sure I’ll be back one day.

Kot?y co said:

I don’t bookmark sites but i will bookmark this! LOL!

apb aimbot said:

Keep posting, I really enjoy your writing.

Johnny Jackel said:

It only goes to show where there’s will there’s a way. Keep on trying. – Eighty percent of success is showing up. – Woody Allen Born 1935

Jerry Jesse said:

I was studying something else about this on another blog. Interesting. Your perspective on it is novel. – Certainty? In this world nothing is certain but death and taxes. – Benjamin Franklin 1706 – 1790

Bentley said:

“Beauty is merely pores and skin deep, but liberal’s towards bone.” – me

Jose Joachin said:

This is a good approach to what, for some, may be a controversial topic. Very well though out post. – That’s our strongest weak point. – Samuel Goldwyn 1882 – 1974

Tampa Plumbing said:

Amazing post, searched for it on Google by the way.

ffxiv hacks said:

Hey, do you have a blog feed I can add to my reader? I looked around but couldn’t seem to find it, thanks a ton in advance.

Zoe the Chatroulette Girl said:

Wonderful, that’s precisely what I was hunting for! You just spared me alot of looking around

Jerry Janovsek said:

It only goes to show where there’s will there’s a way. Keep on trying. – Here comes the orator with his flood of words and his drop of reason. – Benjamin Franklin 1706 – 1790

Jose Jefcoat said:

Just read it and went gosh, I know why I was poor in the debate class. – True, I’ve been a long time making up my mind, but now I’m giving you a definite answer. I won’t say yes, and I won’t say no — but I’m giving you a definite maybe. – Samuel Goldwyn 1882 – 1974

Jesse Juliano said:

Doing some browsing and noticed your website appears a bit messed up in my K-meleon internet browser. But fortunately hardly anyone uses it any longer but you may want to look into it. – It usually takes me more than three weeks to prepare a good impromptu speech. – Mark Twain 1835 – 1910

Jack Janick said:

Hey, found your site by accident doing a search on Google but I’ll definitely be coming back. – I ran into Isosceles. He had a great idea for a new triangle! – Woody Allen Born 1935

lansing help you sell said:

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon

Joe Jeffreys said:

Interesting post reminds me of another gem. – When you cannot get a compliment any other way, pay yourself one. – Mark Twain 1835 – 1910

Joe Jeffreys said:

Interesting point of view.Thanks for the post. – Color television! Bah, I won’t believe it until I see it in black and white. – Samuel Goldwyn 1882 – 1974

Justin Joslyn said:

Just proves the old adage. It’s an ill wind that blows no good. – They’ve finally come up with the perfect office computer. If it makes a mistake, it blames another computer. Attributed to Milton Berle

Juan Jefferds said:

Just proves the old adage. It’s an ill wind that blows no good. – Whatever is begun in anger ends in shame. – Benjamin Franklin 1706 – 1790

christmas gift basket ideas said:

Usually I do not post on blogs, but I would like to say that this article really forced me to do so! Thanks, really nice article.

video hosting script said:

Wow I should have read that over before posting, lol. Sorry about that!

san antonio sell home said:

Hey – nice blog, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

cedar rapids multiple listing said:

I’m new on here, I hit upon this website I find It pretty helpful and its helped me out a lot. I will be able to contribute & aid other users like it has helped me.

boston multiple listing said:

I was looking for this the other day. i dont usually post in forums but i wanted to say thank you!

global agenda hacks said:

A few of the links on your site seem broken. You might want to fix them :)

diet chicken recipes said:

definitely is a actually well thought out website. I certainly enjoyed reading it. Thanks alot!

Hoteles En Panama said:

The design for your web site is a bit off in Galeon. However I like your web site. I may have to install a “normal” browser just to enjoy it. :)

Tyson F. Gautreaux said:

Hmm learning computers is a pain.

Leave a Reply