Use a Unique Page ID
Tabs are getting more and more popular in Web design. And many sites will recommend using JavaScript to create the tabbed navigation automatically. But it's possible to create a tabbed navigation using just HTML codes and CSS.
Use a Unique Page ID
By identifying each page on your site with a unique ID you can create tabbed navigation and style page elements based on the page. While it's quite possible to do this with inline styles, there are many reasons why you might want to avoid inline styles for your Web pages. A page ID allows you to create page-specific effects within an external style sheet.
To create page IDs you use the id attribute on the body tag of your Web page:
Create Your Tabs with an Unordered List
Once you have a page ID, add your tabs to the page using an unordered list. You can create a horizontal tab menu or a vertical tab menu. For my example, I will create a horizontal tab menu across the top of the page.As you can see, I've given the UL an id as well as each tab (LI). That makes it possible to connect each tab with the page ID in my CSS. I use the CSS from the horizontal menu template to turn the list into a menu:
#tabs {
border-bottom: .5em solid #03c;
margin: 0;
padding: 0;
}
#tabs li {
display:inline;
border-top: .1em solid #03c;
border-left: .1em solid #03c;
border-right: .1em solid #03c;
}
#tabs li a {
text-decoration: none;
padding: 0.25em 1em;
color: #000;
}
Match the Page ID with the Tab ID in the CSS
This basic menu will work on most Web pages, but to turn it into a tabbed menu bar, you need to add CSS that combines the page ID with the tab ID.
#page1 #tabs li#tab1 a, #page2 #tabs li#tab2 a, #page3 #tabs li#tab3 a, .page4 #tab4 a{
padding: 0.25em 1em;
background-color: #03c;
color: #fff;
}
I match the page id (#page1) with the tab id (#tab1) in a descendant CSS selector. In the above style property, I made the style very specific. But it's not required that it be that specific. You can connect the IDs with just the body ID and the tab ID as a descendant.
#page1 #tab1 a, #page2 tab2 a{ ... }
And because each tab is identical, I can use commas to separate the selectors and ensure the same styles for each tab.
Use a Body Class Instead of an ID
If you don't want to ID your body tag, you can do the same thing with a unique class on the body tag:
Then call the CSS in a similar way to when you use the ID, but use a class selector:
.page4 #tab4 a{ ... }
Did you find this article useful? For more useful tips & hints, Points to ponder and keep in mind, techniques & insights pertaining to Web Designing, Do please browse for more information at our website :-
http://www.thedesignbuild.com
http://www.webdesign.reprintarticlesite.com
Use a Unique Page ID
By identifying each page on your site with a unique ID you can create tabbed navigation and style page elements based on the page. While it's quite possible to do this with inline styles, there are many reasons why you might want to avoid inline styles for your Web pages. A page ID allows you to create page-specific effects within an external style sheet.
To create page IDs you use the id attribute on the body tag of your Web page:
Create Your Tabs with an Unordered List
Once you have a page ID, add your tabs to the page using an unordered list. You can create a horizontal tab menu or a vertical tab menu. For my example, I will create a horizontal tab menu across the top of the page.As you can see, I've given the UL an id as well as each tab (LI). That makes it possible to connect each tab with the page ID in my CSS. I use the CSS from the horizontal menu template to turn the list into a menu:
#tabs {
border-bottom: .5em solid #03c;
margin: 0;
padding: 0;
}
#tabs li {
display:inline;
border-top: .1em solid #03c;
border-left: .1em solid #03c;
border-right: .1em solid #03c;
}
#tabs li a {
text-decoration: none;
padding: 0.25em 1em;
color: #000;
}
Match the Page ID with the Tab ID in the CSS
This basic menu will work on most Web pages, but to turn it into a tabbed menu bar, you need to add CSS that combines the page ID with the tab ID.
#page1 #tabs li#tab1 a, #page2 #tabs li#tab2 a, #page3 #tabs li#tab3 a, .page4 #tab4 a{
padding: 0.25em 1em;
background-color: #03c;
color: #fff;
}
I match the page id (#page1) with the tab id (#tab1) in a descendant CSS selector. In the above style property, I made the style very specific. But it's not required that it be that specific. You can connect the IDs with just the body ID and the tab ID as a descendant.
#page1 #tab1 a, #page2 tab2 a{ ... }
And because each tab is identical, I can use commas to separate the selectors and ensure the same styles for each tab.
Use a Body Class Instead of an ID
If you don't want to ID your body tag, you can do the same thing with a unique class on the body tag:
Then call the CSS in a similar way to when you use the ID, but use a class selector:
.page4 #tab4 a{ ... }
Did you find this article useful? For more useful tips & hints, Points to ponder and keep in mind, techniques & insights pertaining to Web Designing, Do please browse for more information at our website :-
http://www.thedesignbuild.com
http://www.webdesign.reprintarticlesite.com

Use the feedback form below to submit your comments.

Use the form below to email this article to your friends.

- How to Design a Web Page.
- The Advantages of Web Page Template Designs: Tips and Guides on Which To Choose
- The Basics of Building Web Pages and Customer-Centered Design.
- Designing Web Pages
- Business Web Page Design Tips
- Your own identity on WWW
- Choosing Page Names for Your Website
- Should You Create a Landing Page?
- Review - 2008 Landing Page Optimization Workshop
- 5 Navigation Keys To Get Visitors To Take Action
- Web Accessibility And Your Website
- Gone in 10 seconds
- How to Choose a Website Layout
- How to Improve Bounce Rates to Get More Action
- B2B Marketing Automation Solutions
- Tuning Up Your Landing Page
- The Frugal Marketer's Guide to Finding The Best Web Page Hosting
- Finding the Best Web Site Host for Your New Web Pages



