View Full Version : How to make a tab appear "selected"
bobmac
11-17-2008, 07:22 PM
I am using the Glossy Horizontal Menu http://www.dynamicdrive.com/style/csslibrary/item/glossy_horizontal_menu/ on a site and it's working great except that I can't seem to get the selected tab to appear highlighted or standing out.
The menu is located in a dot net master page, so it is located in one place. The style is not loaded with each page in an inline fashion.
Is there a way to do this? Do I have to change my technique?
TIA...
Schmoopy
11-17-2008, 08:07 PM
A link to the site or code would be appreciated to better understand the problem.
Snookerman
11-17-2008, 08:40 PM
Give the tab you want to be selected a "current" class:
<li class="current"><a href="http://www.dynamicdrive.com/"><b>Home</b></a></li>
bobmac
11-18-2008, 07:01 AM
Give the tab you want to be selected a "current" class:
<li class="current"><a href="http://www.dynamicdrive.com/"><b>Home</b></a></li>
Thanks Snookerman...
But this class assignment would have to be made in the menuing system which is loaded by the master page.
Or would this work if I place this code in the page that I want the tab to appear as selected and would work due to the cascading nature of CSS?
Thanks again...
bobmac
12-11-2008, 05:56 AM
I tried what Snookerman suggested by putting the code in a page. All that happened was that a new menubar appeared below the one generated by the master page.
There's got to be a way to do this. Can someone please help with this?
TIA...
Snookerman
12-11-2008, 07:49 AM
Hmm.. could you please post a link to your site?
bobmac
12-11-2008, 07:56 AM
Yes. It's http://www.ramsayrealty.com/new_web/ and is no where near ready for prime time.
Snookerman
12-11-2008, 08:02 AM
Have you tried this:
<li class="current" id="home"><a href="http://www.ramsayrealty.com/new_web/default.aspx"><b>Home</b></a></li>
bobmac
12-11-2008, 08:17 AM
Have you tried this:
<li class="current" id="home"><a href="http://www.ramsayrealty.com/new_web/default.aspx"><b>Home</b></a></li>
Yes. When I tried it in the specific page, it gave me one clickable link.
I can't apply it in the master page because that's the one place where the menus exist, and each page is rendered from that one master page.
I need the "current" class to be applied to the current page when it is loaded.
In reading some other posts, I saw some references to "server side code" that could dynamically change the menu class to what you have suggested. However, I haven't got a clue as to how I might do that.
Thanks for replying. Please don't give up!
bobmac
01-06-2009, 07:37 AM
It's almost a month since I posed this problem. I sure hope people have not given up on me, much less the challenge.
If I'm told that it can't be done with master pages, then I will accept that.
But I'm curious about the "server side code" that has been mentioned elsewhere.
Can someone chime in on this and help a designer who is trying to code? :confused:
Thanks in advance...or, TIA...
bobmac
01-30-2009, 02:32 AM
I have a new "idea" on how this might be done, but have no clue as to how to do it.
My thought is to have conditional code inside the CSS file. The code would essentially "say" that if the title of the page is Links, then the Links tab should appear selected. endif
Then I could list all the titles of the tabs and their corresponding page titles.
Is this do-able?:confused:
You cannot do that, but sure.. :D
Anyways - can you make one of them have:
class="current"
So I can see what it looks like.. ?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.