Grow your CSS skills. Land your dream job.

stay clicked until another link is clicked help

  • # January 17, 2013 at 11:05 pm

    I finished creating the navigation bar on my website. And i want to have each tab remain white until another tab is clicked on the website. How do i do that? I prefer CSS3 if possible please. Thanks.—->[Website.](http://codepen.io/Jarolin/full/bwLJs “website”)

    # January 18, 2013 at 1:48 am

    If you want to use CSS3, I would suggest that you try using the target psuedo class. If you specify the href of one of the links as the name of one of your divs following a # you can then specify style to be active only when the pages URL has the fragment of a # followed by your div’s name.

    Click Me!

    #mydiv{color:red;}
    #mydiv:target{color:blue}

    When you click the link in the above example, the font color should be altered until you click on another link.

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

You must be logged in to reply to this topic.

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