Grow your CSS skills. Land your dream job.

[Solved] Applying Two Classes

  • # December 25, 2009 at 3:58 pm

    Hi Guys

    On my website, I want a button to stay lit up when that particular page it is linking to it the viewed one. Here is a screenshot of what a button is like usually:

    [img]http://i49.tinypic.com/9vgvp4.png[/img]

    But when I go to the portfolio page .. I want that button to light up like so:

    [img]http://i50.tinypic.com/22ne5h.png[/img]

    I have applied two classes to the anchor tag .. but it is not working .. I don’t know why !! Can someone please help :(

    Thank You.

    # December 25, 2009 at 4:37 pm

    Well, when you need to give an element two classes, you list it like so (no commas between classes):

    "class1 class2"

    And also, in your CSS, if you use "#header ul li a.current" rather than just ".current", that should fix it. Basically, that makes that particular statement more important, so it doesn’t get overwritten by other CSS statements. See http://www.smashingmagazine.com/2007/07 … ould-know/ for more info.

    # December 25, 2009 at 5:04 pm

    Hi

    Falken my friend you are a genius.

    On my local machine I had removed that comma but like you said it got overwritten.

    But now it is working fine with [ #header ul li a.current ] !!

    Thank You Soo Much :D

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".