Color Individual Tabs on the Thesis Nav Bar
This article applies only to Thesis 1.5.1! If you want to color the individual tabs in the Thesis 1.6 menu, please see the article Color Individual Tabs on the Thesis 1.6 Nav Bar.
Many people want to change the background and font colors of individual tabs in the Thesis navigation bar. It is not a difficult task, and the colors can contribute to the overall color scheme of your Thesis blog.
Figure 1: Standard Thesis navigation bar
Figure 1 shows the standard Thesis navigation bar before colors have been applied. The nav bar has been truncated so you can see the “Subscribe” word at the right end.
Figure 2: Thesis nav bar after background and font colors are applied
Figure 2 shows the same nav bar after the code below has been applied. Note that tab 6 remains uncolored and that the font colors of it and the “Subscribe” word are the default font color of the nav bar. Tab 5 is selected and has the gray color specified in the example code.
Using the code examples
All the following code goes into your custom.css file. If you want to color more tabs, just cut and paste the 4 lines for any tab and change the tab numbers.
Change the colors as you wish. The colors in the example are default css color words which are rather ugly! Remember that the color values are hex codes that begin with a pound sign (#) and have six numbers and/or letters, for example:
.custom ul#tabs .home-item a { color: #0FA7B3; }
Determining which tab is which
The home tab is always named “.home-item”. Page tabs start numbering with the tab to the right of the home tab, i.e the tab to the right of the home tab is named “page-item-1″. In Figures 1 and 2 it is the “About” tab. The next tab to the right is “page-item-2″ (called “Tab 2″ in the illustrations), and so on.
Figure 3: Finding the category tab address with Firebug
Category page tabs have their own unique way of numbering, and do not follow a logical counting scheme as do pages. The only way to find their address is with the Firebug add-on for Firefox. If you know how to use Firebug, find the “tabs” element. You will see the category tab addresses listed as “cat-item-00″ where “00″ is the number of the tab element, as illustrated in Figure 3.
If you don’t know how to use Firebug, leave a comment with your site’s URL and I will email your tabs’ names to you promptly.
Change the background and font color of unselected individual tabs
Following is the code to change the unselected background color and font color of the home tab and the four tabs to its right, as shown in Figure 2. Note that there is no code for the fifth and sixth tabs, so they remain uncolored when unselected. However, the fifth tab is selected in Figure 2, so it has the gray color specified in the next section, “Change the tab and font colors of the selected tab.” The last group of lines shows how to change the color of a category tab.
/* Change the home tab unselected color */
.custom ul#tabs .home-item { background: blue; }
/* Change the home tab unselected font color */
.custom ul#tabs .home-item a { color: pink; }
/* Change the about tab unselected color */
.custom ul#tabs .page-item-1 { background: green; }
/* Change the about tab unselected font color */
.custom ul#tabs .page-item-1 a { color: white; }
/* Change the tab 2 unselected color */
.custom ul#tabs .page-item-2 { background: red; }
/* Change the tab 2 unselected font color */
.custom ul#tabs .page-item-2 a { color: yellow; }
/* Change the tab 3 unselected color */
.custom ul#tabs .page-item-3 { background: pink; }
/* Change the tab 3 unselected font color */
.custom ul#tabs .page-item-3 a { color: blue; }
/* Change the tab 4 unselected color */
.custom ul#tabs .page-item-4 { background: yellow; }
/* Change the tab 4 unselected font color */
.custom ul#tabs .page-item-4 a { color: green; }
/* Change a category tab unselected color */
.custom ul#tabs .cat-item-00 { background: yellow; }
/* Change a category tab unselected font color */
.custom ul#tabs .cat-item-00 a { color: green; }
Change the tab and font colors of the selected tab
You can change the background and font colors of the selected tab, too. In Figure 2, the fifth tab is selected, so it has the gray background and aqua font color of the example below. Both regular pages and category pages need to be changed.
/* Change the color of the currently selected tab (pages and category pages) */
.custom ul#tabs li.current_page_item { background: gray; }
.custom ul#tabs li.current-cat { background: gray; }
/* Change the font color of the currently selected tab (pages and category pages) */
.custom ul#tabs li.current_page_item a { color:aqua; }
.custom ul#tabs li.current-cat a { color:aqua; }
Change the tab and font colors when the cursor hovers over it
The background and font color of a tab can be changed when the cursor hovers over it. You can also change other properties, such as underlining and bold, with additional code.
/* Change the color of a tab when the cursor hovers over it */
.custom ul#tabs li a:hover { background: white; }
/* Change the font color of a tab when the cursor hovers over it */
.custom ul#tabs li a:hover { color: black; }
I hope this article has been helpful to you! Remember that you are invited to make a comments. You can also send me an email by clicking the “Contact” button in the nav bar.
©2009 Michael L Nichols. All rights reserved.
What next?
Your comments are always welcome, and are important to this blog’s community! Leave a comment now, or read the comments.
You can find several related articles in the “Related Articles” list below. In the footer you will find a lists of Popular Posts, Recent Posts, and you may browse by Categories, or tags. There’s also a Google Custom Search box to help you find just what you want.
Get free updates by RSS or email!
If you have enjoyed this article, please consider subscribing to article updates, using
an RSS reader, or
by email. It’s free and is a great way to make sure you don’t miss a single article! I also invite you to follow me on
Twitter!
Why not share this article with others!
Share this article with your friends using your favorite social media service, such as
StumbleUpon, or
Digg. Check out the icons below under “Share This Article With Others” for other social media, including del.icio.us, Technorati, Sphinn, Friendfeed, FaceBook, MySpace andLinkedIn! You can also email or print the article, and even tweet it using Twitter!











{ 1 trackback }
{ 25 comments… read them below or add one }
Could you e-mail me my tab names to me? Or explain how to find the tab element in firebug?
I am a newbie at this blog stuff.
Thank you for your time.
Have a nice day!
(:heryl
I answered Cheryl by private email, but here’s the answer for the record.
I am planning to write an article about this, but here is the short version of how to find tab names in Firebug: You have to keep clicking the little triangles to find tab names, but here is the list if you are using the page framework: HTML > body > container > page > tabs. If you are using the full-width framework, the list is a little different: HTML > body > header_area > page > tabs. You will find the names of the tabs listed under “tabs” in the order they appear in your menu bar.
hai..
i wanna ask is this nav. customization tutorial for Thesis 1.5??
because im using Thesis 1.6 and its not work out at all..
please tech me how with Thesis 1.6
Thanks.
This is the best way to customize navigation bar in thesis.
Thanks for the compliment, Surender!
Could you e-mail me my tab names to me? Or explain how to find the tab element in firebug?
Kind regards
RB
I did so by private email.
I’ve just recently switched my theme to Thesis and since it was just given to me, I don’t have access to the forums, so tutorials like these are very helpful for my customization needs. Thank you so much for sharing! :)
Mathdelane, I’m glad you find the articles useful. However, the DIYthemes Forums have an order of magnitude more information than Thesis Theme Tools does. That alone makes it worth the price of admission! If you’re serious about Thesis and your blog, the theme’s cost is a small amount to pay for the customization help the Forum provides.
Thanks Mike for the private email response…I’ll think about your suggestion.
Thank you so much! Very helpful—it has completely changed the navigation of my site for the better!
Yeah Mike,
I agree with Jeff, my navbar is so good. The fact that JobMap remains highlighed can change when I introduce a new page to replace it in the tab list. And again changing the tab colours is a breeze.
Many thanks
RB
What is the tab name for the subscribe button to change the color?
Great tutorial by the way very easy and straight forward to understand!
Thanks
How can you add a second row of menu choices under the first row? This would primarily be for categories.
i recently switched to thesis 1.6 and the navbar code has changed, is this post going to be updated for version 1.6 or those anyone know of where i can find and updated version.
In v1.6 you can use:
li.tab-home a.tab { background: black; }
li.tab-1 a.tab { background: blue; }
li.tab-2 a.tab { background: red; }
…
PAul,
Thanks for the info. Please advise where we insert the new code for v1.6. Still in custom.css?
@robert – correct.
Paul,
Thanks but being dumb about coding, I need to know if I place your code into custom.css from this:
.custom ul#tabs .page-item-2 { background: #ff6600; }
to this:
.custom li.tab-2 a.tab { background: #ff6600; }
Hello, All!
I will be updating this article for Thesis 1.6 very soon, as well as the articles on installing and upgrading Thesis.
Thanks to all those who have stepped forward with advice for the new Thesis version!
I am very interested in this custom color feature, but am not using Thesis. Does the code work with any CSS/Wordpress site (my navigation formatting is not called tabs, but rather #menu, #menu ul, #menu ul li, etc.), or must I install Thesis to access this feature?
In principle, the coloring of the menu tabs ought to work on any theme provided that the theme creates an id or class for the individual menu tabs. The best way to discover if the theme you are using does this is to use Firebug to inspect the menu section — if the individual tabs have classes or id’s then you can color them.
I finally figured out what wasn’t working: I had to remove the “.custom” references from the lines where I wanted to change the color. Since I’m not using Thesis, I only have one CSS file. Thanks for your reply…otherwise I might not have persevered.
can you let me know how to add a cool shadow effect to the navbar background? like in http://blog.2createawebsite.com the red navbar at the top uses a image as the background to add the shadow effect. I want to know how to do that.
Thanks
Not sure why can’t get this to work. I tried both process for unselected page tab and the post by Myatt in custom.css. Any suggestions? Let me know what I need to provide. http://newstreetumc.com. David