Tip: Use search box below or this box, labels in the first right sidebar, archive, ctrl+F for this page or sitemap to find topics

Find help, info, instructions, tips, tricks

Sunday, February 07, 2010

Simple text horizontal navigation bar


Skip to instructions if you are only interested in reading the instructions on how to do create the navigation bar. You may also be interested in How to create static pages as things like contact forms, About this blog, etc is ideally suited to using Pages and the horizontal navigation bar.

Preamble
There are 2 things that we want in designing a blog or website. One is to make it easy for visitors to find content and the other is to make full use of the portion above the fold. And both of these can be fulfilled by creating a horizontal navigation bar either just below the Header or even within the Header itself.

Because I am comfortable with tables (<table>) I have used I have used table to create horizontal navigation bar before. However, current opinion is table should be used for data, and navigation bar which contain links are not data and the proper HTML tag to use for navigation bar should be list (<ul>). This has to do with web sematic which I think relates to how a computer, not a human, see a website. However, this will involve CSS (Cascading Style Sheet) and a lot of coding. The method I am going to describe here just use a simple <div> tag and http://bloggerfordummies.blogspot.com/2008/07/dummies-guide-html-tutorial-hyperlink.html" target="_blank">hyperlinks and is simple to do.

I am not a trained programmer so don't know yet the significance of web sematic and don't know yet what is the significance of using this method on the blog, SEO, whatever, but any significance I doubt it will have a large bearing on the blog, and I quite like the simplicity. If you have doubts regarding using this method, perhaps you can wait until I publish a new post on using CSS. In the meantime, I am very happy using this method for my blog.


How to create simple text horizontal navigation bar without CSS

Step 1: extra "Add a gadget" in the LAYOUT for the blog Header. Briefly, this just involved the simple step of finding editing showaddelement='no' to showaddelement='yes' in the template.

Step 2:Go to LAYOUT, click ADD A GADGET in the blog Header section and choose a HTML/Javascript gadget (formerly called page element). Then type in this HTML, with any number of links you wish(the first code is just to show how it is done, the following codes are to show how to make it look better):

<div>
<a href="URL 1">Link 1</a>
<a href="URL 2">Link 2</a>
<a href="URL 3">Link 2</a>
</div>

where you should change the URL and the "Link 1" to any text that describe the page you want to link to like HOME, ABOUT US, etc.

Now if you use the code above, the links will all be bunched together. If you don't like that, you will have to add space by using the space bar. You can only use the space bar once. If you want to add more space, then you will have to type where nbsp stands for non breaking space.

Further, you may also want to consider putting a vertical bar | (one with the backslash key) to separate the links like what I have done for this blog. I have also experimented with [ ] as separator and if you want to see how it looks, refer to FAQ for Blogger Tips and Tricks

The codes for the above will be something like this:

<div>
| <a href="URL 1">Link 1</a> |
| <a href="URL 2">Link 2</a> |
| <a href="URL 3">Link 3</a> |
</div>


Step 3:If you are happy with the navigation bar above the Blog Title, you may leave it as it is. Otherwise, go back to LAYOUT and drag the gadget to wherever you want.

If you still want to embellish the navigation bar, perhaps you may want to add background color to distinguish the navigation bar from the rest of the blog Header. You can add an attribute background-color:red to the div tag like this

<div style="background-color:red;>
| <a href="URL 1">Link 1</a> |
| <a href="URL 2">Link 2</a> |
| <a href="URL 3">Link 3</a> |
</div>


I have used the example red for the color, but you can use any color or use HTML color code #E1E1E1; for more color choices. For tasks related to color, I have found the free Iconico Color Pic and Color Blender invaluable. For color, I may write a general blogging tip on colors for blog later. In the meantime, this getting started with Color Pic may be useful.

19 comments:

Yelly said...

Hello :D

I used to come to your blogger once and your blog is still awesome! Ttoday I need your help becuase i dont know what happen to my blogger, when I post something it doesnt show the date I published T^T

Please help me!!!!


Thank you..

Peter @ Enviroman said...

Did you do any editing of the template?

Yelly said...

hmm what do you mean??? I got the template from some website T^T

Daniel Yiek said...

Peter,
Blogspot has a new feature that allows tabs under Add/Edit Pages.

http://sarikei-time-capsule.blogspot.com/

I tried in my blog. The feature works but the colour of the links does not turn out well because of my template background. That's not the problem of the feature though

Peter @ Enviroman said...

Did you get that problem immediately after publishing the first post without changing anything?

hls said...

Hello Peter, Thank you for the information about the navigation bar - I much prefer the look to what I initially set up - however, how do I get the pages I created to link to the nav bar codes? Does that makes sense? Can I edit the gadgets choice without losing the page? ugh
thanks, hls

hls said...

http://www.heidispiegel.com/

Peter @ Enviroman said...

I intend to elaborate in a post. If I take too long, pester me.

Peter @ Enviroman said...

Heidi I Spiegel. I think you should learn to make active links in posts and comments or active links when commenting (I may need to update. Let me know if you have any problems using it)

I think also the information you need to make those links in your nav bar is already in this post but if you cannot find it, ask me to edit this post.

Peter @ Enviroman said...

For Daniel Yiek,

Sorry for late response, your comment notification ended up in spam folder.

Anyway you may be interested in Create static pages. I should add this to related posts I think.

Faris vio said...

okeee nice tip...

olarichy said...

sir your blog is second to none on the internet i want to be like you but there are a few restriction in so that i can make some money from my blog and sent my kids to school to i need your help pls reply olarichy.blogspot.com

Peter @ Enviroman said...

Write good content and if you are selling products, do product reviews

LaVonne said...

A BIG thank you. Those were such easy instructions. I did it!

Blessings!

ZiggyFlo said...

I have looked and looked for a simple clear navigation bar and tried over a dozen. They either didn't work or where so complicated, it wasn't worth it.

This is simple, fast, easily changed and DOES THE JOB.
Thanks!
Ziggy

Date said...

Hi Peter, this was so easy. Thanks! Date

heart said...

hi peter,
i just wanted to know if i can create in my blog just like those at the top of this article like -"instructions","How to create static pages" which takes us to another page of my blog itself.

Peter @ Enviroman said...

Heart, I am afraid I can't understand exactly what you want done. You will have to elaborate.

carlaspacher.com said...

I was able to use this in a Wordpress.org blog by switching the link and text around. It did not work as is. When I pasted it as is, it would only show the links.

Thanks so much for this!!! I have been searching all over trying to find out how to create a "horizontal" navigational bar!