Just as we did with the logo section of the navigation bar, we’ll create a <div> that will hold everything to go on one side of the navigation bar. This time that <div> will cause everything inside of it to move to the right side of the navigation bar. Like with the logo, I did this by giving the <div> a class called “float-right” which simply gives it the css attribute float:right.
To create the different page tabs I started off by making an un-ordered list that I gave an ID. Then, for each tab that I want to have in my navigation I add in an <li> element inside of that un-ordered list, and inside each of those <li> elements I added a link to what I want that tab to link to. For example:
<ul id=”nav”>
<li class=”active”>
<a href=”linktoyoursitehere”>Home</a>
</li>
</ul>
(The active class is so I can later give certain attributes to whichever page the user is currently on)
Now for the slightly harder part; adding css styling to those tabs so it looks nice. My first step was to make it so the whole un-ordered list (using the id of #nav) doesn’t show any dots for each element in the list. I did this using “list-style: none”. I then added some margin and padding to stop that section from hitting the edge of the whole navigation bar.
Next I added some styling to the <li> elements of the un-ordered list. I put “li” after #nav” to affect only the <li> elements inside of the <div> with the id of “nav”. “display: inline” makes it so the elements all appear as horizontal. And the rest is either stuff I’ve used before or should be self explanatory.
#nav li {
display: inline;
position: relative;
padding: 0px 0 16px;
float: left;
min-height: 35px;
border: none;
}
The last css elements I added are to change the link parts of the list (really just changing the text that you see). First, I made the base color of each tab be white “#nav a {color: #fff;}”. Next, I made it so that the current page tab has gold text color, and when I hover over a tab it’s text color changes to gold. “#nav a:hover, #nav .active > a {color: #e5c100;}”. The “hover” part should be self explanatory in that it affects that area when you hover over it. Like with the “li” earlier, “#nav .active” will only affect the parts inside of <div> with the id of “nav” that also has the class “active”.
Lastly I added some css to remove any decoration that making something a link adds in (ex. underline), and some padding to space everything out nicely.
#nav li a {
text-decoration: none;
padding: 0px 15px 28px;
}
After aaallll this I ended up with a nice looking navigation bar:
Next week I’ll go with something easier. Just a simple footer at the bottom of the page.


