Tabbed navigation depicts file folder tabs as a metaphor to navigate a website. In this article I'll provide the code for tabbed navigation based on a list that uses only CSS, and one that uses CSS combined with graphic images.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact Advertise on Bucaro TecHelp Advertise Here RSS News Feeds News Feeds

HTML5 Solutions: Essential Techniques for HTML5 Developers

Essential Techniques for HTML5 Developers

HTML5 brings the biggest changes to HTML in years. Web designers now have new techniques, from displaying video and audio natively in HTML, to creating realtime graphics on a web page without a plugin.

This book provides a collection of solutions to all of the most common HTML5 problems. Every solution contains sample code that is production-ready and can be applied to any project.

Click Here

Easy CSS Tabbed Navigation

Tabbed navigation depicts file folder tabs as a metaphor to navigate a website. The tab images may be static or dynamic. Dynamic tabs display a rollover effect when you move your mouse pointer over them, and the currently selected tab will change shade or color.

Tabbed navigation

There are several different ways to construct tabbed navigation. You can use an html table or list, you can combine this with Cascading Style Sheets (CSS), or graphic images, or both. In this article I'll provide the code for tabbed navigation based on a list that uses only CSS, and one that uses CSS combined with graphic images.

Shown below is the html code for the unordered list used to create the tabbed navigation. Place this code near the top of your webpage.

<ul id="nav">
  <li id="home_tab"><a href="home.htm">Home</a></li>
  <li id="about_tab"><a href="about.htm">About</a></li>
  <li id="products_tab"><a href="products.htm">Products</a></li>
  <li id="contact_tab"><a href="contact.htm">Contact</a></li>
</ul>

Note that each html element opening tag has an id attribute and that each list item contains a link. Place the CSS code used to style the list in a separate file named nav.css which will be linked to the webpage by placing the line shown below into the head section of your webpage.

<link type="text/css" rel="stylesheet" href="nav.css">

The first style that we define is for the list as a whole. The code for this is shown below.

#nav
{
list-style: none;
width: 100%;
height: 38px;
margin: 0;
padding-top: 10px;
padding-right: 0;
padding-bottom: 0;
padding-left: 32px;
background-color: #a040a0;
}

This code styles the properties of the list's background, which becomes the tabbed navigation bar. The important properties here are the height and padding- top, which must be set to the correct dimension to place the tabs at the bottom of the navigation bar.

Note that I'm not using shorthand for setting multiple properties of a selector in one declaration. In other words, the lines shown below;

padding-top: 10px;
padding-right: 0;
padding-bottom: 0;
padding-left: 32px;

could be replaced with the line shown below;

padding: 10px 0 0 32px;

I feel that in some cases, using such shorthand can be confusing to the beginner.



RSS Feed RSS Feed

Web Design Sections

CSS3: Visual QuickStart Guide (5th Edition)

With this book, readers can start with a tour of the stylesheet language, or skip ahead to any chapter of the book to look up specific tasks covering just what they need to know. This task-based, visual reference guide uses step-by-step instructions, and plenty of screenshots to teach beginning and intermediate users CSS.

Reader David Diez of Boston, MA says, "This book's strategy seems to be show an example, give a general explanation, provide a few key but brief tips, move on. The writing is clear and concise. ... I continue to be very pleased and impressed with the book. It's proving to be a helpful reference and everything in it is highly accessible. Click here for more information.


[Site User Agreement] [Advertise on This site] [Search This Site] [Contact Form]
Copyright©2001-2011 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268