Create a Responsive Drop down Menu in Blogger


Responsive Drop Down Menu in bloggerThe task of Designing a responsive blogger template starts with the Header and the most important part of Header is the top navigation menu that provides useful links to your inner pages. Responsive drop down menus are viral now and can be seen widely implemented on all wordpress blogs and even mashable.com. Today we are releasing the first ever tutorial on designing a flexible Drop down navigation menu for BlogSpot blogs without using a single script or image! The best part is that it is not just a flat menu but with a drop down list. This makes our tutorial distinguished from those several codes and plugins proposed by some Geeky friends at Github. Using simply HTML5 <nav> tags and CSS3 :checked selectors, we managed to design a menu that we hope would be useful to the blogger community because it is really an efficient menu that is compatible with all major browsers and uses no Jquery at all!

The screenshots below are taken using my personal iPhone to give you an idea of how your blog menu would look like in different screen sizes and in landscape and portrait screen mode. The menu auto adjusts itself using CSS3 media queries which we already discussed in first part of this series.

responsive drop down menu in iphone

DEMO

Tip: If you are using Desktop computer then simply increase and decrease your browser window manually using your mouse and observe how menu toggles between two different styles and expands/collapses when clicked.

Tutorial Series
2: Design a Responsive Header, Menu, Sidebar, Post Content area, footer etc...
3: Using Responsive Images in Blogger..
4. Responsive AdSense Ads..  Really?
5. In Progress..

HTML5 and CSS3 is no less than a blessing that has completely eliminated the need of several JavaScript functions.  We will thus Design a beautiful Responsive menu in blogger using some extremely easy steps. Lets start coding!

What have we planned?

For this tutorial to work for most of those who are not well versed in web designing, I suggest you remove all your existing menus and use this responsive one instead which will remain fixed at the top of the screen like a sticky menu. It is really easy to add a menu this way. You can then add all your links inside this new menu.

Disable Mobile Template

Note If you have activated mobile view for your blog then you must first disable it by going to:

  1. Blogger > Template
  2. click the gear icon
  3. Select No. Show desktop template on mobile devices.
  4. Save

Add a Responsive Menu To Blogger

  1. Go To blogger > Template
  2. Backup your template
  3. Click Edit HTML
  4. Search for these lines or similar. These lines of code exist at the top section of your template

<b:if cond='data:blog.isMobile'>
<meta content='width=device-width, initial-scale=1.0, user-scalable=0' name='viewport'/>
<b:else/>
<meta content='width=1100' name='viewport'/>
</b:if>

Replace all the above code with our custom Meta ViewPort code:

<meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'/>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>

 

I have also included a UTF-8 character set for using some Special characters instead of images.

   5. Now Search for </b:skin>.  Click the black arrow to expand the code.

compressed blogger stylesheet

   6.  Paste the following Styles just above </b:skin>

/*-----Responsive Drop Down Menu by MBT ----*/

body {
margin: 0px;
}
#menu{
background: #50B7DC;
color: #FFF;
height: 40px;
border-bottom: 2px solid #DDD;
box-shadow: 1px 2px 9px #B1B1B1;
border-top: 2px solid #DDD;
}
#menu ul,#menu li{margin:0 auto;padding:0 0;list-style:none}
#menu ul{height:45px;width:1024px}
#menu li{float:left;display:inline;position:relative;font:bold 0.9em Arial;text-shadow: 1px 2px 4px #838383;}
#menu a{display: block;
line-height: 40px;
padding: 0 14px;
text-decoration: none;
color: #FFF;

}


#menu li a:hover{
color: #E4E4E4;
-webkit-transition: all .1s ease-in-out;
-moz-transition: all .1s ease-in-out;
-ms-transition: all .1s ease-in-out;
-o-transition: all .1s ease-in-out;
transition: all .1s ease-in-out;
background: #5FC6EB;
}
#menu input{display:none;margin:0 0;padding:0 0;width:80px;height:30px;opacity:0;cursor:pointer}
#menu label{font:bold 30px Arial;display:none;width:35px;height:36px;line-height:36px;text-align:center}
#menu label span{font-size:16px;position:absolute;left:35px}
#menu ul.menus{
height: auto;
overflow: hidden;
width: 170px;
background: #50B7DC;
position: absolute;
z-index: 99;
display: none;
}
#menu ul.menus li{

display: block;
width: 100%;
font:normal 0.8em Arial;
text-transform: none;
text-shadow: none;
border-bottom: 1px dashed #31AFDB;

}
#menu ul.menus a{
color: #FFF;
line-height: 35px;
}
#menu li:hover ul.menus{display:block}

#menu ul.menus a:hover{
background: #5FC6EB;
color: #FFF;
-webkit-transition: all .1s ease-in-out;
-moz-transition: all .1s ease-in-out;
-ms-transition: all .1s ease-in-out;
-o-transition: all .1s ease-in-out;
transition: all .1s ease-in-out;
}

@media screen and (max-width: 800px){

  #menu{position:relative}
  #menu ul{background:#111;position:absolute;top:100%;right:0;left:0;z-index:3;height:auto;display:none}
  #menu ul.menus{width:100%;position:static;padding-left:20px}
  #menu li{display:block;float:none;width:auto; font:normal 0.8em Arial;}
  #menu input,#menu label{position:absolute;top:0;left:0;display:block}
  #menu input{z-index:4}
  #menu input:checked + label{color:white}
  #menu input:checked ~ ul{display:block}

}

 

Customization:

  • To change the menu background edit:#50B7DC
  • To change the background color on hover edit: #5FC6EB

   7.  Now search for <body>    Just below it paste the follow code which will create the menu structure:

 

<nav id='menu'>
<input type='checkbox'/>
<label>&#8801;<span>My&#160;Blogger&#160;Tricks</span></label>
<ul>
<li><a href='/'>Home</a></li>
<li><a href='#'>About</a></li>
<li><a href='#'>Drop Down <font size='1'>&#9660;</font></a>
<ul class='menus'>
<li><a href='#'>Tab 1</a></li>
<li><a href='#'>Tab 2</a></li>
<li><a href='#'>Tab 3</a></li>
<li><a href='#'>Tab 4</a></li>
<li><a href='#'>Tab 5</a></li>
<li><a href='#'>Tab 6</a></li>

</ul>
</li>
<li><a href='#'>Contact</a></li>
<li><a href='#'>Drop Down <font size='1'>&#9660;</font></a>
<ul class='menus'>
<li><a href='#'>Tab 1</a></li>
<li><a href='#'>Tab 2</a></li>
<li><a href='#'>Tab 3</a></li>
</ul>
</li>
<li><a href='#'>Advertise</a></li>
       </ul>
    </nav>

Customization:

  • Replace the text My Blogger Tricks with your blog title.
  • To add spaces between words use the unicode &#160;
  • I am sure you know how to create new tabs but to create a tab for a drop down list use the following format:

Paste the following code below <ul> or above </ul> to create a drop down list:

<li><a href='#'>Drop Down <font size='1'>&#9660;</font></a>
<ul class='menus'>
<li><a href='#'>Tab 1</a></li>
<li><a href='#'>Tab 2</a></li>

</ul>
</li>

The above menu will create only one drop down list and not multi-level drop down lists because it makes no sense to complicate the design layout for mobile devices. Keeping it simple is best.

  8.  finally save your template and you are all done!

Now play with your browser window and adjust its size manually to see it working just perfectly! :)

Need help?

In the above example, the Main Menu is automatically set to display:none when the screen size width is below or equal to 800px . I used checkboxes to introduces the toggle effect. So as soon as the screen size reaches 800px or further decreases, the CSS media queries detects it and automatically set the mode of the box to checked and apply the styles. This is an interesting technique that we utilized here which eliminated the need for JQuery toggle function.

I have used only two major break points and that is width:1024px  for Desktop computer Screens and 800px for devices which include Tablets, ipads and smart phones. So the entire concept is made extremely easy. I am sure those who understood the above tutorial will find it really interesting to customize it further and add further elements to the menu like a responsive search box at right corner or a RSS Icon etc.

Please let me know if you want any help here. I hope this technique would further help developers to create more interesting blogger templates and contribute further to the blogosphere community. I would love to hear your feedback on this. Please let us know of your precious views so that we could improve it further if needed. Peace and blessings buddies :)

Need Quick Help within 24 Hours? ASK NOW



If you don't want to get yourself into Serious Technical Trouble while editing your Blog Template then just sit back and relax and let us do the Job for you at a fairly reasonable cost. Submit your order details by Clicking Here »

81 comments : Post Yours! Read Comment Policy ▼
PLEASE NOTE:
We have Zero Tolerance to Spam. Chessy Comments and Comments with 'Links' will be deleted immediately upon our review.

  1. Really helpful tutorial. As responsiveness is very important in blog layout. Responsive navigation will help us to maintain it. Thanks a lot Mohammad bro for this tutorial.

    ReplyDelete
  2. Thanks for sharing, I really like your blog..

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Replies
    1. Hi lovedx,
      sharing content is indeed something we love as long as you rewrite the post in your own words and attach credits back to this page as the only favor in return. Remember giving external link is good SEO habit and those who remain greedy in attaching credits stay low on SERPs. :)

      Delete
  5. Awesome naivgation menu brother. Keep posting great things.

    ReplyDelete
  6. This is really an interesting navigation menu. we like that SIr.. Great Job thumbing To MBT.

    ReplyDelete
  7. Really important factors dear :)

    ReplyDelete
  8. Great blogger!
    Nice and looks user friendly and loads fast on blogger blogspot...

    ReplyDelete
  9. Hey Mohammad,

    I installed your mbtnavbar last year (http://www.mybloggertricks.com/2011/07/create-drop-down-menu-in-blogger.html) on my blog here http://www.electrokill.info/. I have nothing to complain about so far, it works perfectly, is it worth the trouble of changing to the new one (The one in this post?)

    ReplyDelete
    Replies
    1. Hi eric,
      Eric if you can customize its code to make it responsive then it would be great.

      One point to clear here is that responsive layouts are only for providing a better UI to your visitors. It wont make your SEO any better or worse but will only provide a more flexible layout to your visitors who browse your site using mobile devices.

      You can either use this menu or continue using that old one. If you think you have great traffic from mobile devices then you should opt to this one. :)

      Delete
  10. Great tutorial for bloggers. These tips are really very helpful and i will definitely apply them on my blogs. :)

    ReplyDelete
  11. This comment has been removed by a blog administrator.

    ReplyDelete
  12. This comment has been removed by a blog administrator.

    ReplyDelete
    Replies
    1. Hi vector,

      I guess your comment got deleted because it contained link.

      Vector could you please re post your question?

      Delete
  13. The best responsie menu thank you bro

    ReplyDelete
    Replies
    1. Hey i have some kind of problems with this menu how can i contact you please do you have skype or something ?

      Delete
  14. thanks for the tut, this is really suitable for my Mobile Specs Blog since most of my visitors are using tablet and smartphones.

    ReplyDelete
  15. Thanks for the nice blog. It was very useful for me. Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us.......... by OPS 571 Final Exam provider.

    ReplyDelete
  16. Sir i have some problem in my site's menu http://news4all1.blogspot.com/

    ReplyDelete
  17. Sir i have some problem in my site's menu http://news4all1.blogspot.com/
    please help me.

    ReplyDelete
  18. Great Tutorial Mohammad. I don't think that Blogger needs to be responsive right now as powerful Google is behind blogger. They have a very strong system to detect all websites browsed through Blogger.

    One more thing, I'll recommend plugins or blogger default mobile view converter as CSS3 is not widely adapted by all browsers (especially IE) and can cause bad user experience if some elements are responsive and others are not.

    Thanks though,
    Mehul

    ReplyDelete
  19. hi..i used blogger template (finalfantasy 6 template) which already menu. How to create/change that menu to become drop down menu?

    ReplyDelete
    Replies
    1. That seems easy bro. Either hook up into your template and replace the code with the above one, or use jquery/javascript to remove your complete menu and add the above with same classes as in that menu so it takes same place on your theme. :)

      Delete
  20. It is really a outstanding post, it is always outstanding learning such material, this post is outstanding in regards of both information as well as information.thanks for talking about you post with us... ..... by MGT 230 Final Exam provider.

    ReplyDelete
  21. Awesome Blog!! That was wonderful. Your thought-about process is marvellous. The way you tell the factor is amazing. you're extremely a master.by MGT 311 Entire Course

    ReplyDelete
  22. I must thank you for the efforts you have put in writing this blog. I’m hoping to view the same high-grade content by you in the future as well. In truth, your creative writing abilities has encouraged me to get my very own website now ;). ..... by BIS 220 Week 5 provider.

    ReplyDelete
  23. This comment has been removed by the author.

    ReplyDelete
  24. i've searched and still can not find 'body' where should i put it then?

    ReplyDelete
  25. I really realise distributing this kind of large post because you make some valid points with which I acquiesce and that is a number of inspirational stuff. I desire to express gratitude you for this informative read.by LDR 531 Entire Course

    ReplyDelete
  26. Thanks! This has been super easy to use and edit.

    I have one problem - it won't work in Firefox? Please help!

    ReplyDelete
  27. If i dont disable mobile view..what will happen sir ???
    Sir I wish to have menus with sub-menu'z(which inturn have sub menu???
    what tweaking i have to do for this??
    help me..
    m also having blog-beginner hoping to get help from giants like u :)
    help me sir!! plz

    thanks sir

    ReplyDelete
  28. Is there a way to make this nav bar sit between the banner and actual content of the page, like the default blogger nav bar? Thanks.

    ReplyDelete
  29. Good morning Sir

    I had a problem with this drop down menù in my blog. The blog is http://blogtestfabio.blogspot.com/ and as you can see, I can't show the sub-folders under "Drop Down" label. Could you hel me please to solve this problem?

    ReplyDelete
  30. Now a days mobile users are increasing compare to using desktops to access internet. Now Responsive is most important factor in web development. thanks to share a wonderful info- web design company

    ReplyDelete
  31. i dn't kw html... i tried bt i coud't find any thing like < body > wt can i do?

    ReplyDelete
  32. Very well written tutorial. that is how a tutorial should be. However, i see the demo, the sizes of the button and navbar are pretty big!!
    Employee Referral Program

    ReplyDelete
  33. I can't find the < body > and ctrl+F does not work.Please help?

    ReplyDelete
  34. Thanks man! It really helped my site

    ReplyDelete
  35. i cant get it sir something wrong visit my bloh
    tipsbyharsha.blogspot.com

    ReplyDelete
  36. cant get it sir something wrong visit my bloh

    maniadsense.blogspot.in

    ReplyDelete
  37. Thanks a lot..looking for this kind of tutorial. I am working on my blog with this style of menu.
    http://www.sayujbuzz.com

    ReplyDelete
  38. I need Your Help Want to create a drop down menu in Dynamic Blogger Template :( not able to create .... will you please help me .... http://knowledgehutt.blogspot.in/ m blog

    ReplyDelete
  39. I don't find "body" in my template,So How? Can you help me

    ReplyDelete
  40. woww nice i like this post..........

    ReplyDelete
  41. Hello guys
    I installed this menu that works wonders. But I'd like to increase the size of the font in the drop down buttons. As the font is super small... its hard to read. Can you tell me where to change that?

    ReplyDelete
  42. Hey can you make this responsive ropdown into a multi level dropdown ?!! Pleasee ... i am looking for a responsive multi level dropdown all over but till date i have found this post as the best. I want to convert this into a multi level dropdown .. please help me.. will i have to add ant css for it ?

    ReplyDelete
  43. Awesome Post.I have made my template responsive using the above code and it looks awesome.Thanks for this post.

    ReplyDelete
  44. Hey Bro, your website has seriously helped me a lot, I have implemented these menus on 2 of my websites, first one is about the Apple Technology www.iappnalysis.com and second is about the new Tizen Technology www.tizenostpkworld.com
    I was in a pursuit of creating a fully responsive website starting from scratch and responsive menu is were I was lagging, but thanks to this tutorial
    I have discovered one trick in blogger that if we set our mobile template from default to custom and then go to any particular widget and add mobile='yes' that we can easily make our blogger profile responsive, you should create a tutorial on this. It will be really helpful to many bloggers :)

    ReplyDelete
  45. Is there any way to make this "sticky" ?

    Thanks!

    ReplyDelete
  46. Thank you so much - finally one that worked!

    ReplyDelete
  47. Hello, it works on desktop version but can't work on mobile version!
    How to solve it?

    ReplyDelete
  48. Hello,
    The responsive menu bar works well on desktop version but it disappears on mobile version. Please advise :)

    ReplyDelete
  49. Hi, the drop-downs are at the bottom of the page. How do i bring them up to the top of the page?

    ReplyDelete
  50. Assalam-walekum Mustafa:
    I am following your blog for last one year. Your work is really commendable. I am proud of you. I also run blogs. e.g. www.essssay.com, I found this article really nice. I have edited to create submenu. please find the error if any. However it is working nice. I added this code in css section.

    #menu li:hover ul.menus li:hover ul.submenus{display:block}
    #menu ul.menus a:hover{
    background: #5FC6EB;
    color: #FFF;
    -webkit-transition: all .1s ease-in-out;
    -moz-transition: all .1s ease-in-out;
    -ms-transition: all .1s ease-in-out;
    -o-transition: all .1s ease-in-out;
    transition: all .1s ease-in-out;
    }

    @media screen and (max-width: 800px){
    #menu{position:relative}
    #menu ul{background:#111;position:absolute;top:100%;right:0;left:0;z-index:3;height:auto;display:none}
    #menu ul.submenus{width:100%;position:static;padding-left:20px}
    #menu li{display:block;float:none;width:auto; font:normal 0.8em Arial;}
    #menu input,#menu label{position:absolute;top:0;left:0;display:block}
    #menu input{z-index:4}
    #menu input:checked + label{color:white}
    #menu input:checked ~ ul{display:block}
    }

    I have not added this code above
    Bu tone error i have noticed that my nav menu is not showing 100% width. It has a margin at left and right.
    can you find this error at my test blog: http://testakb1.blogspot.in/

    My name is AKBAR ALI husband of AZRA AHMAD

    ReplyDelete
  51. Is there a way I can make this ONLY visible on the mobile view?

    ReplyDelete
    Replies
    1. This exactly what i wanted to ask. My blog's mobile view lacks the navigation menu and this would be perfect for it. i hope @admin has an answer for us

      Delete
    2. Sure you can do that by enclosing the Menu HTML code inside isMobileRequest conditional tag. Read this post

      How to hide or show widgets Only in Mobile devices

      Or you can try a more updated and advance version of this menu by reading this post:

      Create a Mobile Responsive Menu

      Hope this answers your question :)

      Delete
  52. hi ,
    how can we add extra submenu inside submenu?

    ReplyDelete
  53. Hi, for some reason the words at the top disappear once i click on the drop down menu. I don't know why. Please help!!!

    ReplyDelete
  54. This worked great on my browser, but disappeared in the mobile version. Can you help? Thanks.

    ReplyDelete
  55. Update:

    You can try a more updated and advance version of this menu by reading this post:

    Create a Mobile Responsive Menu

    Hope this answers your question :)

    ReplyDelete
    Replies
    1. Thank you for that menu was what I was looking for.
      Unfortunately the admin layout looked like this: http://i.snag.gy/jRcF5.jpg
      How can I fix?

      Delete
  56. How to add a search bar in this navbar menu? Thanks for your answer. :-)

    ReplyDelete
  57. this is a very simple and fast loading responsive menu. But i want to know that showing the desktop (responsive) template on mobile device would negatively affect ranking or not?

    ReplyDelete
  58. hi.. i link your menu.. how can i convert this into multi-column?

    ReplyDelete
  59. bro,my website not show this navigation menu,plz help me

    ReplyDelete
  60. Is there a way to adapt this to work with a mobile enabled blog?

    ReplyDelete
    Replies
    1. display a tmobile
      find this code #menu ul{height:45px; width:1024px}
      replace it with this #menu ul{height:45px; width:px}

      Delete