CSS navigation tabs Apr05 '05
Off with "square"
With the power of CSS, it’s possible to create visually appealing navigation tabs – with curved, smooth corners, that blend well with the entire design.
For the next version of this site, I am branching away from the "boxy," and "square" tabs that I currently have, and creating tabs with rounded corners.
"Sliding Doors" technique
In order to create these nicer tabs, I consulted the experts.
First, I fully digested Doug Bowman’s article on Sliding Doors of CSS.
I liked Doug’s approach, but I wanted to see what Eric Meyer had to say about it.
I referenced Chapter 7 of Eric’s book, More Eric Meyer on CSS.
Eric uses almost an identical approach to Doug, except that he uses one less image, in the process.
My result
Here’s a snippet of what I came out with:

The XHTML
The XHTML I used consisted of (the way it should be) – the bare minimum:
<div id="sidebar">
<ul>
<li><a href="/base/" title="Base">Base</a></li>
<li><a href="/about/" title="About Me!">About Me!</a>
</li>
<li id="current"><a href="/blog/" title="Blog">Blog</a></li>
</ul></div>
The CSS
The CSS was equally brief, as well:
#sidebar ul
{
margin: 0;
padding: 0 0 0 22px;
width: 791px;}
#sidebar ul li
{
background: url(images/tabs2-big.gif) 0 100% no-repeat;
float: left;
font-size: 10px;
line-height: 20px;
list-style-type: none;
margin-left: 5px;
padding-left: 16px;
white-space: nowrap;}
#sidebar a
{
background: url(images/tabs2-big.gif) 100% 100% no-repeat;
color: #633;
display: block;
float: left;
font-size: 1.3em;
font-weight: bold;
padding: 5px 16px 5px 0;
text-decoration: none;
width: 0.1em;}
html>body #sidebar a
{
width: auto;}
/* IE-5 Mac Hack \*/
#sidebar a
{
float: none;}
/* End IE-5 Mac Hack */
#sidebar a:hover
{
color: #fff;}
#sidebar #current,
#sidebar #current a
{
background-image: url(images/tabs2-big-ct.gif);
color: #fff;}
Categories: CSS ![]()
Add Feedback (view all)
Leave feedback
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Popular Pages
- Fast rounded corners in Photoshop (4153 recent visits)
- PHP – passing variables across pages (1559 recent visits)
- JavaScript set selected on load (1290 recent visits)
- Removing all child nodes from an element (882 recent visits)
- iPod songs out of order? (747 recent visits)
- Britney - Everytime piano tab (669 recent visits)
- Firefox 3 smart address bar: wildcard search (633 recent visits)
- MySQL LEFT JOIN syntax (543 recent visits)
- Breathe Me - Sia (508 recent visits)
- Tumblr: how blogging should be (405 recent visits)
Similar Entries
- Swap banner image with CSS and PHP (117 recent visits)
- CSS class, or HTML tag? (2 recent visits)
- CSS font-size dialogue! (5 recent visits)
- Misleading CSS link declarations (1 recent visits)
- CSS print style sheet (0 recent visits)
- CSS adjacent sibling selectors and IE 6 (67 recent visits)
Stats
50 unique visits since August 2008
Recent Referrers (click)
- curved tabs css
- curved tabs without images
- rounded css navigation
- curved color tabs
- navigation tabs css
- eric meyer nav tabs
- css square tabs
- css square tabs
- css tabs rounded ul li
- curved tabs in many line in css
- css rounded tabs
- css rounded tabs
- css rounded tabs
- css rounded tabs
- css tabs
- css curved tabs
- tabs sidebar css
- css tabs
- big css tabs
- navigation status css