Knowledge is good only if it is shared. As a new blogger, I have learned to change the Web template, and found out the tips, tricks, hacks, and tweaks of altering the Blogger template, customizing CSS, widgets, layout, blog design, inserting JavaScripts, HTML codes, Google AdSense, and other settings the hard way, through many trials and errors. For the purposes of this guide, I have started with the new “Minima” template. As I make the changes or learn something new, I shall document them. Before changing any template, please remember to save a copy of the current template. After editing the template, preview it, and save it when you are satisfied with the change. Hope this guide will help those who are finding the way around, just like me.

Search Tips for New Bloggers

Search World-Wide-Web

We have extended our month-long vacation by a couple of days. We shall be posting articles the moment we return. We noticed that Google had updated the Page Ranks. New bloggers who have been waiting anxiously for this can check their blogs' Page Ranks. We have the PR checker link in our SEO Tools - Search Engine Optimization article.

The blog we created recently in Aug 2007, Blogger FAQ and Help, has also got its first Page Rank, a PR4. All our blogs are now ranked:-

Tips for New Bloggers - PR6
Business Fables and Management Lessons - PR4
Famous Motivational and Inspirational Quotes - PR4
Blogger FAQ and Help - PR4

Thanks to everyone for the support!

Aug 10, 2007

Digg This Story

Horizontal Menu and Navigation Bar

Many web designs use horizontal menu bar and navigation lists which allow users to easily access the pertinent information in their website. While Blogger makes it simple for you to create a link list through their “Add a Page Element” function, the list is displayed vertically. We shall discuss how you can change that into a horizontal link list, and more specifically, use that as a navigation bar in your Header. We have also included some examples of how you can make the links dynamic by changing the colors, hover and background effects and customizing them to suit your Blog layout.

Before we proceed, it might be helpful for you to understand something about Numbered List and Bulleted List and the various attributes that can apply to the code.

Horizontal Link Lists

1. Apply to all link lists and label lists

If you want all the link lists and label lists in your sidebar to be displayed horizontally, go to Template -> Edit HTML and scroll to where you see this and insert the code (shown in red):-

.sidebar ul {
display:inline;
}

.sidebar li{
display:inline;
}


In some templates, you may insert the code here:-

.sidebar ul li {
display:inline;
}


Preview the template. This is what you would see.

Horizontal Menu Navigation Bar

2. Apply to one specific list

Instead of having a style that applies to all the lists, you may want to have only one of the link lists appear horizontally. First, you need to create that list by going to Template -> Page Elements -> Add a Page Element. Choose “Link List”, add your items and save.

Now is the tricky part. You would have to locate that particular segment of the code where this list appears and find out the widget ID for that list.

For discussion purposes, let us assume that we want the link list titled “My Blogs” in our left sidebar to be displayed horizontally. We go to Template -> Edit HTML, and check the box that says “Expand Widget Templates.”

Next, we searched (Ctrl-F) for “My Blogs” and found this section:-

<b:widget id='LinkList2' locked='false' title='My Blogs' type='LinkList'>


From here, we know that this link list has been assigned an ID LinkList2. To define a style, we went to the /* Sidebar Content */ portion of our template and included this code (Note: the code can be inserted into any part of the <head> section but for ease of reference we have inserted it here):-

/* Sidebar Content */

#LinkList2 li{
display:inline;
}


This is what we got:-



Only this list is displayed horizontally. The other lists are not affected. If you want this style for the labels, do the same. Locate the widget ID which is likely to be id='Label1' or id='Label2' and then insert the code:-

/* Sidebar Content */

#Label1 li{
display:inline;
}


Text Link Menu Navigation Bars

With this basic understanding of how the “display:inline” code works, let us now combine this with hover and link effects to customize our very own horizontal navigation bar. Again, if you are truly keen to do something unique for your Blog, peruse the discussion in Links Hover and Rollover Effects to understand the different styles that can be used to make the links more dynamic.

1. Simple Navigation Bar

We want a row of text links pointing users to certain important parts of the Blog. The links blend into the Header and will look like this:-

Horizontal Menu Navigation Bar

In Template ->Edit HTML, insert this style definition under /* Header */:-

/* Header */

#newnavbar ul li{
font-size:100%;
list-style-type: none;
display:inline;
padding:0px;
margin:10px;
border:0px solid;
}


Other than the display:inline style, the other variables can be changed. You can have a larger or smaller font. The margin and padding set the space in between the words and can be changed. If you want a border around the word, set the border value to at least 1px.

Scroll further down the template and check if you see this:-

<div id='header-wrapper'>
<b:section class='header' id='header' maxwidgets='3' showaddelement='yes'>


If the number of maxwidgets is set to “1”, change it to “3”. If the showaddelement is “no”, change it to “yes”.

Save the template. We shall now create the list. Go to Template -> Page Elements -> Add a Page Element and choose to add HTML/JavaScript in your Header. The link list code you can add is as follows:-

<div id='newnavbar'>
<ul>
<li><a href="URL of Home page">Home</a></li>
<li><a href="URL of Music page">Music</a></li>
<li><a href="URL of Books page">Books</a></li>
<li><a href="URL of Links page">Hot Links</a></li>
<li><a href="URL of Profile page">About Me</a></li>
<li><a href="mailto:EMAIL ADDRESS">Contact</a></li>
</ul></div>


Insert the relevant words and URL links into the above example. If you want to link to a label, click the label in your sidebar to obtain the URL for insertion into the code (shown in blue). The URL should look like this:-

<li><a href="http://tips-for-new-bloggers.blogspot.com/search/label/Three%20Columns">Three Column Templates</a></li>


This link widget can be moved about. Try placing it below the Header and then above the Blog posts to see the difference in the layout. Preview the template and save it if you like the new horizontal navigation bar position.

2. Adding Link and Hover Effects

We have now a simple horizontal navigation list. Let us make it visually attractive and distinguish these links from the other links in your Blog. This is done by introducing the hover and rollover effects. For example, in addition to the above code we added into the template, we can have these as well:-

/* Header */

#newnavbar ul li{
font-size:100%;
list-style-type: none;
display:inline;
padding:0px;
margin:10px;
border:0px solid;
}

#newnavbar li a{
color:#dfffed;
}

#newnavbar li a:visited {
color: #57E964;
}

#newnavbar li a:hover {
color: #F88017;
background: #ffff66;
}


In this example, the links are light green in color, visited links turn into bright green and when you hover your mouse over the link, the text is orange with a yellow background. Try changing to different set of color combination by inserting the appropriate color codes.

The resulting navigation bar will be this:-

Horizontal Menu Navigation Bar

3. Menu Bar below Header

As mentioned, the horizontal Navbar can be in the Header or aligned just above the Blog Posts. There is yet another position where you can place it, i.e., below the Header and above the Blog posts and sidebars. In the new Blogger templates, you should see this:-

<div id='crosscol-wrapper' style='text-align:center'>
<b:section class='crosscol' id='crosscol' showaddelement='yes'/>
</div>


Change the showaddelement from “no” to “yes”. In Template -> Page Elements, you should be able to see an additional slot between the Header and the Blog posts where you can insert Page Elements.

Image Link Menu Navigation Bars

1. Simple Navigation Bar

If text links are still too unexciting for you, try having image links instead. Do up some small little images to represent the different parts of your Blog that visitors can go to. You can search the net for free downloadable images, create new ones, or edit and resize current ones with image editors like Picasa. Once you have these images, host them on a free image server and take note of the image URLs.

The modification to the template is similar to that of text links. In Template ->Edit HTML, insert this style definition:-

/* Header */

#newnavbar ul li{
list-style-type: none;
display:inline;
margin:0px;
padding:30px;
border:0px solid;
}


The space in between the pictures (padding) may be changed depending on the number of images and the size of each image.

To add the horizontal row of navigation image links, go to Template -> Page Elements -> Add a Page Element and choose to add HTML/JavaScript in your Header. The image link list code you can add is as follows:-

<div id='newnavbar'>
<ul>
<li><a href="URL of Home page"><img src="URL of Home image"></a></li>
<li><a href="URL of Music page"><img src="URL of Music image"></a></li>
<li><a href="URL of Books page"><img src="URL of Books image"></a></li>
<li><a href="URL of Links page"><img src="URL of Links image"></a></li>
<li><a href="URL of Profile page"><img src="URL of Profile image"></a></li>
<li><a href="mailto:EMAIL ADDRESS"><img src="URL of Email image"></a></li>
</ul></div>


The portions of the code in blue are the addresses where you want the users to be directed to. The parts in red are where your images are hosted on an image server.

This is how the neat horizontal picture navigation bar can look:-

Horizontal Menu Navigation Bar

2. Adding Link and Hover Effects

We can throw in some effects into the picture links. Just to give you an example, we added this hover links code in addition to the above:-

/* Header */

#newnavbar ul li{
list-style-type: none;
display:inline;
margin:0px;
padding:30px;
border:0px solid;
}

#newnavbar li a img{
height:30px;
width:30px;
}

#newnavbar li a:hover img{
height:40px;
width:40px;
background: #ffff66;
}

#newnavbar li a:visited img{
height:40px;
width:40px;
background: #6D7B8D;
}


What we had done was to fix the navigation bar image link size at 30px by 30px. There is no border around the image. When the mouse cursor hovers over the image link, the image is enlarged to 40px by 40px with a yellow background. Any visited links will have a grey background behind the image.

Horizontal Menu Navigation Bar

While this looks interesting to have, do note that any change in image size also affects the surrounding text alignment. You can reverse it. Change the hover and image sizes to smaller values so that the images 'shrink' when the mouse hovers over them.

Update:

Navigation Bar within Header Image

A number of us have uploaded background images into the Blogger Header. After adding a Text Link or Image Link menu bar, you may notice that it is positioned either on top or below the Header image. You may have designed the image with a space reserved for the Navbar, either at the top, bottom or to the side. To adjust the position of the Navigation Bar and have it within the Header Image, refer to our article Add Navigation Bar in Header Image.

There are numerous dynamic styles that you can try. If you have followed our guides, you would at the least have an idea how you can tailor-make yours. This is an introductory article. We may follow up with another one on multi-level tabs.

In designing your layout, avoid having too many gimmicks. Stick to one or two nice hover effects and if you'd like, change the color scheme every few months so as not to bore your regular readers. Go ahead, try it and have fun creating your own Navigation bar!

© Tips for New Bloggers

Found this article useful? Mention us in your post, subscribe to our feed, link to us, or bookmark this site. Thanks for your support!AddThis Social Bookmark Button

33 comments:

CrazyKinux said...

The bar displays, but it does so below the header image. I'd like it to be at the bottom of the image. How can I do that.

Thanks for the tip by the way!

bizwhiz said...

Hi CrazyKinux

Just addressed your query in a new section of the article. You may like to try it.

netbobz said...

Hi bizwiz!

Another great post, congrats!

I was always coming back to your blog to check for new articles, but wasn't finding any. Later I discovered this post accidentally while going through your right sidebar. I guess others might also get deceived like this. So why don't you change your main page to point to your recent posts?

bizwhiz said...

Hi netbobz

We are going to do a little revamp to make it easier to locate the articles, starting with our FAQ site. Thanks for the suggestion.

diddy47 said...

hi...god article...i don't suppose there is a way to do a horizontal label display 9 or link display) using widget ID and not HTML page elements...I've been working on this for some time now...any help.......http://kundaistreet.blogspot.com/2007/08/horizontal-label-displaysos.html

bizwhiz said...

Hi diddy47

In our article, under Horizontal Link Lists - Apply to one specific list, we gave an example of how you can create a horizontal label list. In doing so, only the label list is displayed horizontally without affecting the other links. This is probably what you are looking for.

After having a list, it is for you to decide whether you want to add hover and mouseover styles to it. We have some guidelines in the article too.

BeBopGrandma said...

Hi me again. lol Well i got the navigation bar inserted but there verticle. How can i get them horizontal? here is my page http://bebopgrandma.blogspot.com/

BeBopGrandma said...

I figured it out yipee!!! for me. lol

Samhita Sarma said...

Navigation is nice.I want to ask you one thing.When I insert an image into my blog I am getting an X mark in my blog.How can i locate the image I want to insert into my blog header.

bizwhiz said...

Hi Samhita Sarma

Since your query is a pertinent one raised by a number of Internet Explorer users, we have discussed the possible causes in detail in our article Images not shown in Internet Explorer.

Nate said...

Hello,

Is there any way to change the default padding for the widgets? I added a horizontal navbar and it's perfect for my site, but I wound up with a lot of white space on the top and bottom (which I am sort of trying to overcompensate for right now with some design tricks).

Take a look at the link below and you should see what I mean.

http://burritobracket.blogspot.com

Thanks,
Nate

bizwhiz said...

Hi Nate

You seemed to have already reduced the padding in the #header h1 { to 0. Perhaps for the margin in the #newnavbar ul li{ you can insert a 4-value rule. If it is one value like "margin:15px;" there is a margin of 15px on all sides. In this instance you may want a margin on left and right only. So maybe try "margin:0 15px 0 15px;"

If you have a Header description, the padding in #header .description { can also be adjusted to reduce the white space.

D. Elizabeth said...

Hi Biz! Do you know a hack for modifying the label display bar that comes up when you click on a label (the thing that says, "Showing posts with label ___")?

I'd love to change it to say something more personal like, "Here's everything I have to say about ___"

Possible?

p.s. you ROCK

dom-cin said...

bizwhiz... is it possible for the bar to be embedded in my header picture so that my layout would not be ruined? huhuhu... the navigation bar only appears either above or below my header picture. i don't prefer like the look.

bizwhiz said...

This post has been removed by the author.

bizwhiz said...

Hi dom-cin

We have addressed that in this article Add Navigation Bar in Header Image. It should explain the alignment settings to have the Navigation Bar within the Header image.

Jazmanie said...

This site completed my blogging needs. Thanks and congratulation for your high achievement. Your site is my reference and guide.

I admire how you neatly arrange all the blog directories on the left sidebar (all the small 80x15 buttons side by side), how can we do that, is it using same procedure as link list? I've tried but didn't work. help please.

bizwhiz said...

Hi Jazmanie

They are image links. You can have a look at our article Hyperlinks and Image Links for the image link HTML code.

The Beading Gem said...

The directions were very easy to follow. Love it the way it is on my blog. Thanks.

Ashley said...

Thank you so much for this tutorial, but I have a problem! My third link in the list is showing up as a bullet! Can you help? Thanks!

alayfield@gmail.com

Toni said...

I created an image in photoshop with the text for the links in the image. How do I replace my current left sidebar links with this one image and arrange the links so they will line up with the text in the image? I've searched all over. There are lots of codes for doiing this on other websites but not Blogger. There are alot of tutorials for making photoshop created menus. I'm using the minimal black template with a three column layout.

bizwhiz said...

Hi Ashley

You have a private blog which we cannot view and thus do not know what the problem could be. In any event, if you are unable to find out the cause, you can always remove that link and create another. To identify or change the bullet link code, you can also look up our article on Numbered List and Bulleted List.

bizwhiz said...

Hi Toni

I read from your post that you have found your solution from various forums. We shall therefore not comment further on this.

This is Sijo Kodiyan said...

Hi me again. lol Well i got the navigation bar inserted but there vertical. How can i get them horizontal? here is my page http://pictip.blogspot.com/

bizwhiz said...

I see a link list but no navigation bar. Anyway, follow the guidelines in our article to create a horizontal list.

Matt said...

Hey bizwhiz. As usual, your site is awesome. :) I have a question regarding the Horizontal Navigation Menu. The template I'm using creates a "blue dot" when you use bullet points. And I understand in order to keep the links separated, these bullet points are necessary. But with my template, it makes the links "not look nice" (for lace of a better term). You can see what I'm talking about on my test blog: http://mjctestblog.blogspot.com
Do you know if there's a way to get rid of those "dots" or maybe somehow make it look more appealing, like appearing beside each link instead of "behind", for example... Anyways, I'm sorry if that was a bit confusing. Keep up the awesome work with this awesome site. :)

bizwhiz said...

Hi Matt

You want to get rid of the dot? Go to .sidebar li in your template and remove the image link.

Matt said...

Thanks bizwhiz. Your site, again, is just incredible. And your responses are highly valued. Keep it up man. Great stuff. :)

Matt Plavnick said...

This is a great post. I've had success installing the new bar, but I'm also getting a border around the whole page element that I can't figure out how to remove. Tips?

Thanks for all the great advice.

bizwhiz said...

Hi Matt Plavnick

You may refer to this article to understand how you may Add or Remove Borders in CSS Templates.

bluretina said...

I tried to put link menu at footer with this method. I think I managed somehow but I can not figure out how to manage padding between the links, colors, highlight effects etc. they do not work. any ideas?

my blog is http://arcibi.blogspot.com

thank you.

bluretina said...

ah I made it >_< thanx anyway. this is great content. I'll put up a link of yours on arcibi now. cheers!

anuj said...
This post has been removed by the author.