Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Applying Two Classes

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27315
    TheN00b
    Participant

    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.

    #68669

    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.

    #68671
    TheN00b
    Participant

    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)
  • The forum ‘CSS’ is closed to new topics and replies.