Reputation: 19
This question should be simple enough, taking an html class and ran in this problem while trying to complete an assignment. I made my navigation bar by making an unordered list, formatted it using CSS, but now I can't make an ordered list on the page because of the formatting I did for the navigation bar.
Upvotes: 2
Views: 9516
Reputation: 125
The navbar HTML should be:
<ul id="navbar">
<li><a href="home.htm">Home</a></li>
<li><a href="about.htm">About</a>/</li>
<!-- ... -->
</ul>
And the CSS should be:
ul#navbar {
display:inline;
/* Any other CSS you want */
}
ul#navbar li {
display:inline;
}
And then that CSS won't affect any other ULs you create.
Upvotes: 1
Reputation: 16705
You need to write your generic list styles and then override them for your navigation bar:
ul { /* Basic UL styles here */ }
#main-navigation ul { /* Navigation menu styles here (assumes a container with ID 'main-navigation') */ }
Upvotes: 0