Responsive Retina-Ready Menu

A responsive, touch-friendly and Retina-ready menu with three layouts for different browser sizes.

The
New
Collective

🎨✨💻 Stay ahead of the curve with handpicked, high-quality frontend development and design news, picked freshly every single day. No fluff, no filler—just the most relevant insights, inspiring reads, and updates to keep you in the know.

Prefer a weekly digest in your inbox? No problem, we got you covered. Just subscribe here.

Feedback 117

Comments are closed.
  1. Hi,

    I got your menu worked perfectly fine locally but when I uploaded the same on my apache server, the icon fonts are not visible. Do you I need to add any extra configurations when uploading it on apache server.

    Thanks,
    Raneesh

  2. Cool! Thank you very much. I have a question: Why div.main.clearfix’s height is alwalys 600px? Tks again, cheers!

  3. I deleted 2 choices, but now the menu is to the left. Is it possible to center the menu ?
    J’ai effacé 2 choix, mais maintenant le menu est à gauche, est-ce qu’il est possible de le centrer ?

    • I do some solution, but I’m not sure if it will work with you 😐

      in file default:
      change .main {

      max-width: 60em;//to smaller value

      ***********
      in file component:

      change width of nav ul to smaller value like:
      .nav ul {
      max-width: 800px;
      }
      and change .nav li { width:25%;} // this number come from divided 100 on number of choices
      which means if you have 4 li use this function : 100/#li;

      if you have choices more than 6 do the opposite 😀
      i hope this is helpful 🙂

  4. Hello,
    You are very good. I tried using your menu on my website: http://www.apolloborges.com/index.php/2011-07-25-15-56-49

    I struggled a bit and got it, he is in joomla. I had to put all the css menu in a single file.

    I got it to work, except I can not center the menu and I can not leave the menu close the two right and left side edges and not close to the top.
    The size of the space I have is 1000px. Put this value as the menu goes to direct. Actually I do not know if I’m putting this value to the right place.

    Could you help me? It’s almost perfect .. just need to adjust so that it is exactly flush with the two sides in the center of the page.
    Regard´s
    GUILHERME BORGES
    [email protected]

  5. Nice work Stéphanie ! I love this effect !

    Thanks

    And your personnal website is very nice 😉

  6. Hi, First at all, thank u for the awesome menu source.
    But Im wondering how can I change the height of the menu?
    I want use your source on ma page but it seems like ur menu style has their own height and
    for me, Html starter, its quite hard to figure out the code which controls the height of menu part.

    Plz describe how I re-design this source.
    Thank u.
    (Im not gud at Eng. Hope u can understand ma words)

    • hi ,

      to change height go to file component

      and change these classes as you like :

      /* Animating the height of the element*/
      .nav a {
      height: 5em;//this value
      }

      .no-touch .nav a:hover ,
      .nav a:active ,
      .nav a:focus {
      height: 10em; //this value
      }

  7. Lovely design Stéphanie, I’m adapting it to use it with a re-design of my personal site. The vanilla JS method is pretty impressive, kudos to Justin!
    Here’s a jQuery adaptation which achieves the same goal (see http://jsfiddle.net/cssimsek/AgLyJ/2/) :
    (function($){
    $(‘#menu > ul’).hide();
    $(‘#menu’).prepend(“ Menu”);
    $(‘#menutoggle’).on(‘click’, function(){
    if($(‘#menu > ul’).css(‘display’) == ‘none’){
    $(‘#menu > ul’).show(‘slow’);
    }
    else {
    $(‘#menu > ul’).hide(‘slow’);
    }
    });
    })(jQuery);

    • I’m no sure why you would want to use jQuery while you can do those kind of transition in raw CSS3 🙂

  8. Actually, just realised that the jQuery version I offered up is profoundly problematic… It works nicely when $(window).width() 520 … I’ll have to try to fix this..

  9. Hello and thanks for a great tutorial!

    Iv’e been working all day to try solve a problem, i want to center this menu on top of my page.

    Like on this site: http://www.billykick.com/ (you have to scroll down a bit then the navigationbar will appear)

    Anyone know how this could be achived? iv’e put the navigation bar in this tutorial in my header.
    Is it the header thats need new code or is it something in the tutorial?
    Maybe a whole new solution?

    A huge thank you to anyone who can help 🙂

    Current header code in css and html:

    http://codepad.org/UaNxHtgE

    Thanks again!

  10. Thanks for the tutorial! It´s really amazing, but someone asked me if there is any option to use this on a wordpress based webpage… that would be awesome!

    Any ideas?

    Thank you!

  11. nice tutorial- I’m morphing the design with another one that’s got a bit less jquery involved, but either way I’m not able to get the icomoon graphic to show in ie8. Evernything else is good. -Code in progress so not able to show you right now. I see you have the icons show in yours (ie8), any trick to get that to show? I’ve added the checkbox for ie7 and before (and also tried without) but still not working.

  12. I absolutely love this nav system. I’m still working through the tutorial but I was wondering – how would I adjust the coding to have the menu running along the left side of my page, vertically (where the individual li would expand out to the right)?? Thanks so much!!

  13. Found a small bug that’s been driving me nutz!

    .navtoogle i {
    z-index:-1;
    }

    With this property, and you are viewing the page on a mobile device or a narrowed browser, I found I’m unable to set a bg color to the parent div as the menu icon (3 lines) goes behind the div. If I set this to 1, the menu icon is on top of the div, however, it no longer functions. I wasn’t too interested in using this and it requiring a white bg but it is what it is. Unless someone has a recommendation on how to fix this.

    • I’m having the same problem. If I assign a bg color to #menu then the icon is no longer visible. I can fix this by raising the z-index, but then the icon won’t toggle on Chrome or Safari. It works fine on FF. SO frustrating because this menu is terrific!

    • So I slept on it and came up with a couple of options.

      First, you can assign a bg color to and work around that.

      Second, you can abandon the use of the icon in the tag and use a bg color on #menu {}, .nav .navtoogle {}, or both. Use a menu picture as a bg image within .nav .navtoogle {} as your menu toggle icon.

      I really appreciate the simplicity and functionality of this code. Thanks so much to the author!

  14. I greatly appreciate all the work you have done on this project and it’s simplicity. I do have 2 questions:

    1. Anyone else notice how there is a faint gray background behind the “header” text? Or is there just a break line? My retina display on my macbook pro is showing me that there is a slight difference in color above the menu bar.

    2. Any easy fallback for IE support? I know CSS3 is not supported, but is there a nice way for it to break down and not totally die? I know a previous poster created a jQuery way to use this menu, would that be better supported in IE?

    Thanks!

  15. I, your menu is just amazing with a very good tutorial but i have a little problem, on my website http://www.extrasya-world.eu/index.php just after the menu I have a big space which I can’t change ! I tried to change the .css and the .html but i don’t find answer, if you can, please help me 🙂 budet_b[at]epita.fr

  16. What happens if my website only needs 5 or 4 menu items?
    I noticed that if I leave just 5, they don’t feel the screen.

    Any sigestions on this?

    • Hi!

      I needed 5 menu items and for a quick fix I went for giving the li-items some more width:

      .nav li {
      float: left;
      // width: 16.66666666666667%;
      width: 20%;
      text-align: center;
      -webkit-transition: border .5s;
      -moz-transition: border .5s;
      -o-transition: border .5s;
      -ms-transition: border .5s;
      transition: border .5s;
      }

      from 16% to 20%. If that’s not a solution for you, maybe you can try to center the whole on your page?

    • karlien – THANK YOU THANK YOU THANK YOU A MILLION TIMES!!!
      I have been seeking the answer for this ALL day! You are awesome =)

  17. i just want to add sub menu items to this menu …
    the items to be displayed in the pop down with the effect provided to the menu titles (home,blog,contact etc…)
    please help me i am new to web development .

    this menu is awesome…

    thank you …

  18. Hi absolutely love your menu bar.
    I’m relatively new to web programming which leads me to my question.
    Is it possible to use your own color fonts in the menu and if so where would you do this?

    I understand how to use the icomoon, however it is very limited when it comes to wanting multiple colors.

  19. Hi, great tutorial and I love this menu. I have a problem though and I hope someone can help me.
    when I’m testing it with mobile screen, the menu appears “behind” the rest of the page’s elements.
    this is what the menu looks like
    <a href=”www.shoofpremier.com/normal.png” title=”normal” rel=”nofollow”>

    and here is what happens when i test with the small screen size
    <a href=”www.shoofpremier.com/problem.PNG” title=”problem” rel=”nofollow”>

    can any body help?

  20. I love this menu but when I implement it I have a large blank space between the responsive menu icon and the page text. I tried setting a negative margin for the text but that results in the menu displaying correctly for the first few menu items and then the rest is transparent to the text on the page. I tried changing the z-index but that did not solve the problem. Anyone have a solution for this?

  21. Excellent tutorial! thanks a lot.
    I have a question. How can i change the height of menu?
    thank you.

  22. The javascript at the bottom is overly complicated, and incorrectly hides submenu. All you need is a button, and a click event:

    Menu

    And then a simple “toggle” javascript, or jQuery toggle, for the “menu” ID. You can Google an example toggle javascript or jQuery example.