DivitoDesign

Everything for the Web Professional

How-to: DropDown CSS Menu

Information about the Author:

Name:

URL: http://twitter.com/divitodesign

Description enjoy design, write articles, like typography, love football, keep chilling.

More on: CSS

206 Comments

  1. I will definitely give this a shot on some of the sites I own and run. Great article and it’s quite obvious you’ve received a lot of attention from it.

    Thanks!

  2. Great! I love CSS only menu’s :D

  3. very interesting article well written man… http://www.consolemodz.com

  4. good post! thank you very much

  5. tracy says:

    Great tutorial,thank you!!! ;)

  6. THANK YOU!!!! I was working on a site for a friend and he wanted to do this exactly and I looked all around the web and couldn’t find anything. Finally I found what i was looking for, bookmarked, thx!

  7. Thank you. i was looking for this.

  8. Hi Stefan,

    You are amazing. I am going to create 2 level categories with drop down feature.

    I have tried various different scripts but each have some issues in various browsers OR they have big bunch of JavaScript code which harm to SEO.

    You Code is really Search engine friendly code and working on all browser.

    Thanks Man!!

  9. This is great! I jsut moved to wordpress and find it really fun to work on CSS. Your tutorial is so easy to follow.

  10. Your code blocks are absolutely beautiful. How did you do that?

  11. BlackJack says:

    very good work … I’ll use it on my own website :) thanks

  12. Cat forum says:

    Anyone know if this code works in firefox 3 and Internet Explorer 7?

  13. Thanks for this article Stefan, I was reading up on this one over the weekend. Maybe we could get our heads together at some point and develop an online menu creator tool? Looks like it would be simple enough…

  14. Just what I was looking for. Indepth tutorial allows anybody to easily add these to their site.

    Thanks

  15. @Web Design Sussex

    “Maybe we could get our heads together at some point and develop an online menu creator tool?”

    Let me know if you guys get together and do that, I would be very interested in using it! Post a reply if you do and ill be sure to check it out.

  16. nagaraja says:

    Thanks for the detailed tutorial .but when i created same code in my website pulldown doesnt work .could you suggest me for creating menu or give the entire code which i can learn and try once again.awaiting for your reply.

    Thanking you.

  17. Thank you for this lovely tutorial

  18. Car Mad says:

    Thanks for this one. I just use this on my site

  19. Webdesign says:

    Looks great!!! jQuery can do it better but still…awesome!

  20. I think I should try this CSS tips for my new CuocThiSEO website. Thanks for your clear guide!

  21. Renee says:

    oh, awesom work I will implement it, thanks!

  22. Ruby says:

    body {
    behavior: url(csshover.htc);
    font-size:11px;
    font-family:Arial, Helvetica, sans-serif;
    }

    behavior propery is not working in Visual studio 2005

  23. oyun says:

    thanks. also works in ff3. that’s what I was looking for..

  24. Thank you very much for the drop down menu css code. I will try it out and let you know if it worked for me.

  25. FixSor.com says:

    thanks .. great help for me and my buddies..

  26. Hossam says:

    I am really thankfull to you .. was looking for this all day long!

  27. Chy King says:

    You are a great coder!

  28. Thanks for the article, I will be implementing this in my next site. I have tried this on my own a few different times, but could never get the desired effects, your explination was great.

  29. Keith says:

    If you take a look at my website you will see it is an array of web-pages tied together via links. I started it this way because I developed the content for each page slowly and rather than wait to get all the content I simply completed a page as I got the material. However, now I want to tie these pages together as one site and I don’t want to repeat the menu on each page. I’m certain I can code the menu once and put that URL on every page consequently reducing the code I will be required to type, I’m a pitiful typist. Can you tell me how to do this? I know it’s very simple but I’m fairly new to XHTML and CSS and I desperately need help.

    Oh, your explanation and documentation of horizontal menus was excellent. I will be using it on my website, thanks.

    • Keith; thanks for your comment. That’s a problem simple HTML/CSS can not solve. You have to add a line of PHP code on the place where you want to place your menu:

      < ?php include 'menu.html'; ?>

      I hope that helps. Otherwise it might be interesting for you to take a look at WordPress. That does stuff like that automatically.

      • Keith says:

        Thanks Stefan,

        I appreciate your suggestion and I have already begun to play around with PHP 5 so, I will look into using it to rectify my problem.

  30. This is extremely useful for a web design noob like myself

  31. Lee says:

    Just learning how go make menus. Your description of CSS is more lucid than anything else I’ve been able to find. Just about got it all except for how to remove the little circular bullets that appear by the sub-menu items in your example. I thought that the setting list-style to “none” was supposed to eliminate any bullets.

    ul#nav {
    list-style: none;
    padding: 0;
    margin: 0;
    }

    Best,
    Lee

    • Johan Enevoldsen says:

      Yeah, i could use some help to, on how to remove the bullet points?

    • Thanks for your question. Setting the list-type:none; helps, but I tend to do it with both classes (ul#nav + ul#nav li).

      ul#nav{ list-type:none; }
      ul#nav li{ list-type:none; }

      Hope this helps. If not, try adding the !important; notice.

  32. [...] Bullet Point Horizontal Menu Interesting horizontal menu including bullet points. [...]

  33. Pear-Crunch says:

    Ouh Great!
    I respect and love your work. peoples, like you have made the web world baby toy. Thanks, Keep it up.

    http://960.gs/
    this link may helpful for designers

  34. Johny says:

    Any simple way to add icom/images instead of text ?

    Webdesign”>Webdesign

  35. Wayne says:

    I’ve implemented the menu successfully, but I’ve got an issue… The beneath the dropdown menu is a table containing an that I’m using to query data from an SQL database. The table is flush up against the bottom of the drop down menu; when I now hover over the options, they present themselves under the table, as if they were on separate layers.

    Any thoughts?

    • Wayne says:

      I’m not too sure why the comment I just left didn’t present itself properly…

      Here it is again:

      I’ve implemented the menu successfully, but I’ve got an issue… Just beneath the dropdown menu is a table containing an asp:repeater that I’m using to query data from an SQL database. The table is flush against the bottom of the drop down menu; when I now hover over the menu options, they present themselves under the repeater, as if they were on separate layers.

      Any thoughts?

  36. Tom Burgess says:

    Is there a way to center the menu?

    • There is. The parent element (for example the

      your ul#nav menu is in) should be touched too.

      div.menu{ text-align:center; }
      div.menu ul#nav{ text-align:left; width:1000px; margin:0 auto; }

      The margin:0 auto; make sure the margin right and left is the same, so that makes it centered.

      Hope that helps.

  37. j says:

    This is garbage, not working

Please Respond and Give your Opinion

We use Gravatar to handle our avatars. Get one there!