Hi, I have a piece of code for a collapsable menu that i am using, and the problem is that I want the link that I click on, when I am on that page, to be bold. I tried implementing that in CSS, but all it does is become bold when the i press on the link. Here is the css that I am using for that part: .arrow { display:inline; float:left; background:url(images/arrow.gif) no-repeat; width:8px; height:9px; margin-top:7px; margin-left: 5px; } .menutitle{ cursor:pointer; margin:4px auto 0 auto; background-color:#f73433; color:#fff; width:184px; padding:3px; text-align:center; font-weight:bold; } .menutitle a { color:#fff; } .submenu { width:190px; background-color:#ffffcd; list-style:none; margin: 0 auto 0 auto; } .submenu a { float:left; margin: 3px 0 0 9px; font-size:11px; color:#000000; text-decoration:none; } .submenu a:active { font-weight:bold; } Code (markup):
if i understood what you want you just have to change .submenu a:active by .submenu a:visited i'm not very sure about if this is what you want
Well, visited wouldn't work, because then if I visit Link 1, it will be bold, but then if I don't like whats on Link 1's page, I will visit Link 2, but Link 1 will still be bold, and now Link 2 will also be bold. What I want is only one bold link at any given time.
Ah wait I think I know what you mean... You want whatever the current link is to be bold-- just because the person is on that page? If I understand you correctly, you can have a "current" class in your html-- assuming your page is static-written, you move the "current" class on each page's html to the correct label. If the page is dynamic, then many people have a different body id instead.
static as in www.site.com/page.html ? If that's what you mean, then yes. It's static. So how would i do that? I have a site that has current in the navigation, but it doesn't work. It always highlights the home page. (www.gatedisguise.com)
Ok, I know what you mean. I'll go look for that code, I have it somewhere. PS: Might want to change your sig, asking for rep will get you banned. #submenu { width:190px; background-color:#ffffcd; list-style:none; margin: 0 auto 0 auto; } #submenu a { float:left; margin: 3px 0 0 9px; font-size:11px; color:#000000; text-decoration:none; } #submenu .active a { font-weight:bold; } Code (markup): Try that!
Thanks, that worked well. I only changed .active a to a.active,and it worked flawlessly (once i figured out exactly how it worked) For a second i was like, "wait, how did i end up on my site" and then i figured out what you were doing. Thanks, that's exactly right. I'll fix that when I get a chance to. What im doing now is a project i have to get finished, so I was just using my site as an example. Thanks +REP to both of you.