Creating navigation or menu tabs in Blogger
| A typical navigation bar/tabs |
A navigation or menu bar is a bar made up of tabs. “Behind” those tabs are links -to internal pages, other web sites etc. Making navigation tabs is not that difficult. They are basically links with some styling added for visual appeal. While links are arranged vertically, navigation tabs are usually arranged horizontally. (If you come here looking for dropdown menu, then read Installing a multi level CSS dropdown menu).
In this tutorial we will install the bar just below the header, a typical place for navigation bar. The bar will be added as a gadget via Page Elements page. The advantage of using a gadget is that if you want to remove it later on, it can be done easily without editing the HTML.
But in order to do that, the template must have a page element (to contain the gadget) at that particular location –below the header. In Minima template (the template I’m using to test this project) as with most other templates, the is no such element. What do we do then? We create it.
![]() |
| No element to add in the widget/gadget |
Step 1. Adding a Page Element
Adding a page element is done in the HTML.
- Go to Dashboard>Layout>Edit HTML.
- Back up your template.
- Look for the following lines (or something similar) in your HTML codes:
<div id='header-wrapper'> <b:section class='header' id='header' maxwidgets='1' showaddelement='no'> <b:widget id='Header1' locked='true' title=Your Blog Title(Header)' type='Header'/> </b:section> </div>
- Right under it, paste this code:
<!--Navigation page element starts --> <div id='navibar-wrapper'> <b:section class='navibar' id='navibar' showaddelement='yes'/> </div> <div style='clear: both;'/> <!--Navigation page element ends -->
Step 2. Adding in the tabs
- Go to Layout>Page Elements sub tab.
- Click Add-A-Gadget link below the header.
- Scroll down the Add-A-Gadget window and select HTML/Javascript.
- Leave the title box empty.
- Copy and paste the HTML code below.
<!-- Navigation tabs start --> <a href="YourLink1" class="navitabs" title="TooltipText1">ButtonText1</a> <a href="YourLink2" class="navitabs" title="TooltipText2">ButtonText2</a> <a href="YourLink3" class="navitabs" title="TooltipText3">ButtonText3</a> <a href="YourLink1" class="navitabs" title="TooltipText4">ButtonText4</a> <a href="YourLink5" class="navitabs" title="TooltipText5">ButtonText5</a> <!-- Navigation tabs end -->
- Replace YourLink with the url of each link, TooltipText with the text you want to appear when you hover the button and ButtonText with the text you want show on each button.
- Click Save.

A working navigation tabs, before styling
Step 3. Styling the tabs.
Copy the code below and paste it into the CSS section of your template. (CSS stands for Cascading Style Sheet. It is a segment in your template code that is responsible for styling your page. It starts from <b:skin><![CDATA[ and ends with ]]></b:skin>).
/* Navigation tabs start */
a.navitabs, a.navitabs:link, a.navitabs:visited {display:block; width:150px; height:25px; background:wheat; border:1px solid black; margin-top:2px; text-align:center; text-decoration:none; font-family:verdana, arial, sans-serif; font-size:12px; color:black; line-height:25px; overflow:hidden; float:left;}
a.navitabs:hover {color:white; background:olive;}
a.navitabs:active {color:white; background:indianred;}
/* Navigation tabs end */
![]() |
|
The finished product |
Step 4. Customizing
- Change the colors, height etc. to suit your taste.
- You can add or reduce the number of tabs. To add, go to Step 2 and add in the links.
- Change the width of the tabs in Step 3 until they align nicely with your blog header.
- You can move the bar to the top of the header if you want,
- In Step 1 no.3, inside the header widget, change
locked='true'tolocked='false'. - Drag & drop the bar element in Page Elements page.
- In Step 1 no.3, inside the header widget, change
That’s all and good luck.
Before you leave:
- Do you find this article useful? Share it via Tweet This or Add This buttons below.
- Any suggestion, question or comment? Please post it in the comments below.

































70 comments to "Creating navigation or menu tabs in Blogger"
A couple of your tips (this one, the one about changing the color of your comments text), say to "copy the code below and paste it into the CSS section of your template."
Does that mean just anywhere in the Edit Template HTML box?
I also have a problem with the text from the last button appearing on the line underneath the buttons when viewing the page in IE (but not FireFox) after following these instructions.
Interestingly, that text disappears if you highlight the button (but reappears again right after). Any idea what this could be?
CSS (Cascading style sheet) starts from:
< b:skin >< ![CDATA[
and ends with:
]]>< /b:skin >
you will notice the similarities in syntax with the code I've given.
Ahh..just as you're about to scream "I did it!", along comes every webmaster's nightmare -IE :).
I don't really know what's causing this problem, but try changing the tab width to 130px, that will remove it.
"Ahh..just as you're about to scream "I did it!", along comes every webmaster's nightmare -IE :)."
LOL Exactly!
Thanks for both answers. Gonna try resizing the tabs now. 8)
Resizing worked. :)
By the way, after I resized it to 130, the buttons were (naturally) noticeably smaller, and worse: bunched over to one side with an obvious gap on the other side. So I played with the sizes, and found 137 was the highest I could go without having the "spill over" problem. And that looked much less crappy.
Now, I'm still using the default blogger column widths (I haven't resized them like Greenlava shows you how to do in another post), so if anyone else reading this is having the same issue, 137 might be your magic number. :)
Thanks again!
I thought I typed 137px...Need to remind myself -Proof-read before posting.
Hey! Everything worked great but I was wondering if there was a way to add dropdowns to these?
Hi Dumb Status,
Dropdown menus are a bit different. Better build anew. This is on project list too.
But for the time being you can go to CSSPlay. They have all sorts of menus there.
I used your code but for some reason, when I click on the links on the menu bar, rather than going directly to the URL, they go to www.halfwaytohousewife.blogspot.com/www.halfwaytohousewife.blogspot.com rather than just www.halfwaytohousewife.blogspot.com
Can you offer any suggestions?
Katie,
You omitted http://. To correct it, use this:
http://www.halfwaytohousewife.blogspot.com.
One more thing I notice your header is slightly misaligned. To correct it, set margin to 0px in #header.
Perfect!!! Thank you so much for your help!
thanks greenlave,
a question is, as we done above, how can one link to that nav. buttons (if suppose external link then ok but) within same blog how can we link to that nav. buttons we just created?
and how can we create the other page to be display on click nav. buttons.
plz clarify about both points.
thanks in advance.
thanks greenlava,
(1)after creating nav.buttons how can we link them in the same blog. (ok for external link we can change in href but what about inside link)
(2)and to that link how/where will we creat the linked pages . lol
thanks in advance.
@Katie,
You're welcome. Come back anytime.
@tanweer, melody,
1. To get the link to an internal(post) page. Click the post title to display only that post. Then look inside your browser address bar, that's the post link/address. You use that link in the nav. tab.
2. Create a page first, then link to it. Not the other way around. In Blogger (post) pages are created automatically when you publish a new post.
sory greenlava, first it seems that there is error in posting comment, later i observed that both the comment gt posted.
thanks for your kind cooperation.
No problem.
greenlava,
what should i do so that
instead of wheate color an small image will appear in that block and another image for mouse rollover (instead of indianred color)
i can upload images for that on other domains.
thanks in advance.
Put an id in each of your link code, like this
< a href="YourLink1" id="navitab1" class="navitabs" title="TooltipText1" >ButtonText1< /a >
then define the background for each id in CSS:
#navitab1 {background:url(Link_To_Navitab1-Image;}
#navitab1:hover{background:url(Link_To_Navitab1-Hover_Image;}
Do this for all tabs.
hi green lava,
for step 3, i have to copy the codes into which part of the template? i cannot find the (CSS) in my template.
Hi mike s.,
Please refer to comment#3.
Paste it immediately before ]]>< /b:skin > line.
I am so close to getting this done, except.... I paste step 3 in my CSS and I loose my side bars and everything moves to left, causing my whole blog to be off center.
I see the buttons and they link too, but it is just text and smooshed. Help. By the way I love all the tips you put on your site.
So I posted this towards the end of my CSS like you said to mike above, but when I change the width and color, nothing happens. Here is my blog so you can see how it looks. Can you be more specific on what to change in the HTML to make my buttons appear in a box with a background color, etc. Sorry I am not the best with HTML.
Hi Mama Snow,
Welcome to my blog :)
I think I know what the problem is. You have this near the end of your CSS:
.numberingcomments{
float: right;
display: block;
width: 50px;
margin-right: 5px;
margin-top: -35px; /*comments-counter position*/
text-align: right;
font-family: 'Century Gothic','Lucida Grande',Arial,Helvetica,Sans-Serif;
font-size: 30px;
font-weight: normal;
a:link, .numberingcomments a:visited {color: #445566 !important; text-decoration: none !important;
a:hover, .numberingcomments a:active {color: #FF9933 !important; text-decoration: none !important;
}
You left out two closing curly braces "}". The first one is for .numberingcomments and the second one is for a:link...
Just insert the curly braces.
When you are done with that, add in the codes for the navigation tabs at the end of CSS...and you'll be all right.
I am still struggling. I see what you mean. I do not have a brace by the a:link. I think I have one before numbering comments though. I tries it and it still isn't doing much.
I think I am just more visual. Could you show me above where they go exactly.
Here is what I have as of now...
}
.numberingcomments{
float: right;
display: block;
width: 50px;
margin-right: 5px;
margin-top: -35px; /*comments-counter position*/
text-align: right;
font-family: 'Century Gothic','Lucida Grande',Arial,Helvetica,Sans-Serif;
font-size: 30px;
font-weight: normal;
a:link, .numberingcomments a:visited {color: #445566 !important; text-decoration: none !important;
a:hover, .numberingcomments a:active {color: #FF9933 !important; text-decoration: none !important;
}
/* Navigation tabs start */
a.navitabs, a.navitabs:link, a.navitabs:visited {display:block; width:150px; height:25px; background:wheat; border:1px solid black; margin-top:2px; text-align:center; text-decoration:none; font-family:verdana, arial, sans-serif; font-size:12px; color:black; line-height:25px; overflow:hidden; float:left;}
a.navitabs:hover {color:white; background:olive;}
a.navitabs:active {color:white; background:indianred;}
/* Navigation tabs end */
Thanks so much.
Mama Snow,
It's like this:
.numberingcomments { float: right; bla bla bla font-weight: normal; <--- NG
.numberingcomments { float: right; bla bla bla font-weight: normal; } <--- Good, with a closing curly
a:link, .numberingcomments a:visited { color: #445566 bla bla bla !important <--- NG
a:link, .numberingcomments a:visited { color: #445566 bla bla bla !important } <--- Good, with a closing curly
Thank you so much for this Greenlava. I plan on revamping my blog and stumbled upon this post today and it really broke the process down in a great way.
I do have a question though. I have seen navigation bars on which if you place your mouse over a tab, more tab options drop down. I was wondering if you know how to do that?
hey greenlava !!!
marvelous.. i luv my new menu... i tried it on a bogus blog before applying on mine.... marvelous !!!
thank you, thank you
my only question is similar to the one of katie and tanweer:
let's say that i have tab name "fashion" in my menu. And let's say i have 5 posts that i want people to see when they click on the "fashion" tab, do i have to put the link for each post under the tab ? (a coma between each , indefenetely) isnt there a faster way to do this because if ihave 1000 posts , i will have to put 1000 links in the html code ?
thank you in advance !!!
Momma Morgan,
Pls see comment no.9.
mustbedgy,
All you have to do is label each post (in post editor) with the word "fashion". Then, under "fashion" tab put the the link to that label: http://YourBlogName.blogspot.com/search/label/fashion
Thank you so much for providing this information. I'm using it on a new blog I'm building, using a heavily customized template. So far, I'm only getting a text link. The buttons are not showing. Below is the code I'm using. I've altered the text colors to match my blog links, but left your background colors for now.
You are providing a wonderful service. Thank you!
/* Navigation tabs start */
a.navitabs, a.navitabs:link, a.navitabs:visited {display:block; width:150px; height:25px; background:wheat; border:1px solid black; margin-top:2px; text-align:center; text-decoration:none; font-family:verdana, arial, sans-serif; font-size:12px; color:#5588aa; line-height:25px; overflow:hidden; float:left;}
a.navitabs:hover {color:#006699; background:olive;}
a.navitabs:active {color:#5588aa; background:indianred;}
/* Navigation tabs end */
graceonline,
I can't check out your blog (set to private)so I'm guessing here.
Maybe to forgot to include the class attribute (class="navitabs") in the links HTML in Step 2.
I want to thank you so much for your AWESOME tutorials. You have help me a bunch!
I AM STUCK!
I want to stylish my bar but I don't understand part 3. I try to place it on EDIT HTML but it gives me an error.
can you help me? I try to understand the answers you gave the others but no help!
Thank you in advance for taking the time to help me!!!
Rocio,
Copy the code in Step 3 and paste it immediately before
]]>< /b:skin > line
in your Layout>Edit HTML page.
THANK YOU GREENLAVA
answered my question (mustbedgy) pretty well
thank you again
Hi there,
Your site is fabulous and darn side more helpful than Blogger discussion forum. I am trying to build the navigation buttons you describe and am half way and everything is going smoothly, but I don't know where the CSS section of the template is? Please could you give me detailed instructions on how to find or do this. I have never coded a thing in my life so have followed your instructions by the letter, but the CSS letters are still not something I understand.
@Tamara,
You're welcome.
@Rainbow Coloured Shadow,
Thanks, please read comment #34.
Thanks for the speedy response. I tried that. Now my buttons are in a line underneath each other and have no boxes. Am I doing something wrong? I assume that there is a "}" after the 150px.
My site is rainbowcolouredshadow.com.
Also how do I change the colours. I see the steps you have listed and will try that as soon as I have the boxes working, but how do I know the names of my blog colours when the colour tab just gives me a reference number rather than a colour name. Can I insert the colour numbers where you have the colour names or is there a way to find the name of the colours I have selected so that the buttons match the colours of my blog?
Rainbow Coloured Shadow,
I think I know the problem. You copied the code when my page wasn't completely loaded into your computer. Any way this is the complete code:
/* Navigation tabs start */
a.navitabs, a.navitabs:link, a.navitabs:visited {display:block; width:150px; height:25px; background:wheat; border:1px solid black; margin-top:2px; text-align:center; text-decoration:none; font-family:verdana, arial, sans-serif; font-size:12px; color:black; line-height:25px; overflow:hidden; float:left;}
a.navitabs:hover {color:white; background:olive;}
a.navitabs:active {color:white; background:indianred;}
/* Navigation tabs end */
Yes you can use Color hex code instead of Colornames.
To find a hex code of any color, I use colorpicker from http://www.allgraphicstools.com/
Greenlava,
I'm having problem to add second tier to my existing menu tab. Can you give me the right code to add in as second line? You may check my menu tab at www.beautygalleries.blogspot.com. Thank you.
Greenlava,
Thank you for your tutorial it is really helpful. Now, I have another problem. I just want to add one additional layer of dropdown under text button 1 that only show when the mouse point at the button. Can you give me the code? Thank you.
Hi. I was just wondering. I did everything you wrote, but the tabs won't align with the content wrapper, and they're pushed all over to the left. Do you know if i did something wrong or something to help?
Thank you for getting back to me about the issues I was having (comments #31 & #32). You are so kind to check each of our comments and blogs. I'm not ready to publish yet, so the blog is not up for viewing. I apologize for any inconvenience that may have caused you.
I had copied your code exactly, so class was not the issue, but I had added a note, beginning with the greater-than, exclamation point, dash-dash; and ending with dash-dash, greater-than sign, as follows:
9/26/09: To add navigation tabs just under header, added the "navigation element code" (far above) and navigation tabs code immediately above, per advice of Blogger Central at http://bloggersentral.blogspot.com/2009/07/creating-navigation-tab-in-blogger.html.
Today, I moved the note BELOW the new code and the problem disappeared. Don't know why that should make a difference, but it did.
Thanks again for all the good you are doing for us. I'll twitter this page later today.
How do I create a navigation tab similar to what you have on this site with the Home and All Posts so that blogger does not put up the label vs all posts flag, but that it is a permanent feature such as you have on your absolutely helpful blog site?
Rainbowcolouredshadow.com
@BG and SL,
My latest post is about dropdown menu, check it out.
@Linn Marie Hansen,
Please add this line in CSS:
#navibar-wrapper {margin: 0 auto; width:950px;}
@graceonline,
Can't say what the problem is since I could not view your blog, anyway glad your solved it.
@Rainbow Coloured Shadow,
I answered it in replying to your comment in the other post.
Greenlava, i'm having problem when applying this method..
can u help me..
i'm really not sure about the part that needs to add the code..
when i'm trying to put the code, it says an error..
Program Sukarelawan Teknologi (PROSTEC),
I see you've added the HTML part (step 2).
To add the CSS code in step 3, you need to find /b:skin in your template code. Then add in the CSS code right before the line.
i already did it, but how to change that button color?
where can i find the color code?
Program Sukarelawan Teknologi (PROSTEC),
The code for button color is background:wheat. Replace wheat with your own colorname. You can find a list of colornames here
thanx.. how about make the button edges smoothly..?
it is possible to do that?
Program Sukarelawan Teknologi (PROSTEC,
The easiest way to do that is by using image as a button.
To make smooth cornered buttons, go to GRSites. Then download the button into your pc, after that upload the image to image host such as Photobucket or Flickr. Once uploaded, get the link to the image and use it in the background code (the code in comment no.49).
To learn how to use images as background, read Using image as background.
for example, if i only put 3 button below my header..
can i move all the button to the center?
Program Sukarelawan Teknologi (PROSTEC),
Yes you can. Add this line:
#navibar-wrapper {margin: 0 auto; width:592px;}
where the width must equal the sum of all tab widths (plus margins).
thanx greenlava..
awesome..
u're great.
My pleasure Program Sukarelawan Teknologi (PROSTEC).
Thank you so much for the tutorial!
Now I have an another question: do you have a tutorial or a code on how to apply a navigation tabs but with pictures and a scroll down options like the one from "MckMama"<--click to see her navigation bar to see what I mean.
Thank you so much for all your help!
Have a Lovely♥Day!
~RocÃo a.k.a."MamÃ♥Picture"
☼¨`*•.♥RocÃo♥.•*¨`☼,
Welcome back :), that's a dropdown menu. Read Installing a multi level CSS dropdown menu.
To replace tab text with a photo just replace (in the HTML code) the word with an image code, you know the img src="http://blahblahblah thing.
I loved this post. I found I easily put in my nav bar. It was refreshing for it to be so simple. The great thing I found too is if you change template then this formatting ends up being another sidebar, which is great! So then I followed your steps again to put in a nav bar and now I have a nav bar and another sidebar.
Thank you
April Ficek
If you drink coffee. Learn how you can improve your health one sip at a time.
http://www.livetothemaxblog.com/2009/10/do-you-drink-coffee-then-try-cup-of.html
Website: http://aprilficek.organogold.com/na/biz/
April Ficek,
My pleasure.
Hey!..Buddy..Nice work here ...Keep up :-)
Himal Rangana,
Hey thanks. Don't forget to come back...
I am having a problem with my youtube video feed widget. Everytime I change something in the title of a video-this punk rock group intermintently puts inself in place of the specified video. This has happened many times.I have done everything I know to stop this. Here is a new page I am making http://bartlettobit.blogspot.com/
The intruders youtube name is KakashiMr
The title comes up as undefined intruder when it knocks my James Dean Video off Bloggersentral is a great site that I have gotten many tips from. My main site is http://bartletttexas.blogspot.com/ which I am still working on. Email me at lanahill@att.net
HillBillyFilly,
View my answer in the Any question/comment? gadget in the right sidebar.
Thanks for the answer & your time GreenLava, but it didn't really solve the problem as I would like. Yes I am aware of how to embed a youtube video and have done some both ways(widget & embed)
Yes I did just want that one James Dean video to load as I thought it good to put on my Obit page. The keywords I used should bring that one video in exclusively. And did and does on others till I go back and change the title or something, and then here comes the same guys with the same videos--no matter what the keywords. They did it on a Shirley Temple--they have skulls & punk. It's some type of security breach, and it almost has to be being perpetuated by them. I did a malware check on my computer & the program did find 1 malicious, and removed it. Thought that solved my problem but it did not. I guess I will have to report to Google & YouTube. If anyone knows anything let me hear from you. lanahill@att.net http://bartletttexas.blogspot.com/
Thanks Much
HillBillyFilly,
Try reporting it in YouTube Help Forum.
When I insert the styling code, it styles the tabs fine but changes the background of the entire blog to white. What do i do to keep it black?
Jon,
1. Make sure you copy the full code. Do this by hovering the code, clicking View Source and select all in the source code window.
2. Paste the code immediately before ]]>< /b:skin > line.
I'm trying to change the font to Verdana Bold and to remove the space between your navbar hack and my header; I'm unsuccessful so far. Help?
http://oohbooks.blogspot.com
Cara Powers,
I answered your question in Blogger Help Forum
thanks i did it but still in the process of customizing it. thanks a lot.
Now it's your turn to say something