Two columns Three columns Mixed cols and rows Gallery Archives Clean & Clear Dark or Black High Contrast/ Impact Blog Designs New Corporate/ Professional Unconventional Designs Liquid layouts Web Design Firms Our Favorites What's Popular Last 20 submissions
Horizontal Menus Vertical Menus Multiple/ Nested Levels

CSS Examples CSS horizontal Tabs

Date: 10/07/2004 CSS horizontal Tabs

Author: CSS Drive/ Based on Eric's Meyer's Tab.

A horizontal tab interface that's extremely lightweight and scalable. Each tab is simply a list element and set to "display: inline" to cause it to align side by side instead of vertically.

The HTML:

<ul id="tablist">
<li><a class="current" href="http://www.cssdrive.com">CSS Drive</a></li>
<li><a href="http://www.yahoo.com">Yahoo</a></li>
<li><a href="http://www.google.com">Google</a></li>
<li><a href="http://www.news.com">News.com</a></li>
</ul>

The CSS:

#tablist{
padding: 3px 0;
margin-left: 0;
margin-bottom: 0;
margin-top: 0.1em;
font: bold 12px Verdana;
border-bottom: 1px solid gray;
}

#tablist li{
list-style: none;
display: inline;
margin: 0;
}

#tablist li a{
text-decoration: none;
padding: 3px 0.5em;
margin-right: 3px;
border: 1px solid #778;
border-bottom: none;
background: white;
}

#tablist li a:link, #tablist li a:visited{
color: navy;
}

#tablist li a:hover{
color: black;
background: lightyellow;
border-color: navy;
}

#tablist li a.current{
background: lightyellow;
}

Comments (11)

10x a lot for the great article.

#1: Ivan Stefanov on 03/19 at 10:55 AM

CSS Forums

CSS Forums: latest threads Last Post Info
Free Wordpress Theme - Gambling Stitches (1) 08/20/2008 05:32 pm
By: topwpsites
Web Design Co Redesign (1) 08/19/2008 12:23 pm
By: slapaddicts
Please review my website (2) 08/19/2008 02:31 am
By: webdesignernew
Please Review AdsGlobe.com – Free Ads Globally (1) 08/19/2008 02:29 am
By: kaiz49
Not a full review (2) 08/19/2008 02:27 am
By: webdesignernew