So you've created one sweet web application, and you're very proud of the functionality, but the User Interface is somewhat lacking. Hey, don't worry, it happens to all of us. We are programmers after all, not UI designers! But don't despair; this tutorial will show you how to separate the pages of your application into ergonomically distinct chunks, by the use of CSS tabs. That's right, CSS, no tables involved!
So here we've set up the initial style of the tab bar, with the height, width, and font. The two most important declarations are the left padding to set an initial little indentation, and the bottom border of 2 pixels.
These are the common styles for both kinds of tabs. The cursor is set to emulate a link, the margin is set to separate each tab apart by a couple of pixels, and the borders are set. Very important is the changing of the display to 'inline', which enables them all to peacefully coexist on the same line, side-by-side. The vertical-align attribute doesn't really work as you or I would expect, so instead I employ the use of top padding to bump the image and text down closer to the middle of the tab.
.taboff { color: #666666; background: #dddddd; }
Here we make the inactive tabs look inactive. We make the font a little more faint, and the background gray.
And this is the magic that makes a tab 'active'. We make the font bold to stand out, the border a bit thicker, and then move it down 2 pixels to give the illusion that it's flowing into to the border, and it's attached to the bottom part of the screen. Make sure you set the background color, otherwise you'll still see the bottom border, and the illusion won't really work.
After all is said and done, Here's what the finished product should look like: