How do I keep a clicked navigation button highlighted?

Discussion in 'HTML en webdesign' started by Nolan1, Nov 27, 2014.

  1. Nolan1

    Nolan1 New Member

    Nov 18, 2014
    Likes Received:
    I have a row of buttons in my nav bar, all like this one:

    <a href="#"><div id="navButtonOverview" class="navbutton" onclick="overviewPane()" />Overview</div></a>

    How do I make the button stay a certain color after they click on it? (It is to emphasize the tab/page unity.)

    I thought it would be by:

    .navbutton:active { background-color: red;

    ... but that doesn't change anything on button click. As part of the onclick innerHTML in the JavaScript, I added:

    + "<style type='text/css'>#navButtonOverview{ background-color: #93c2e9; }</style>"

    ... but the style did not change.

    What else should I try?

Share This Page