Ready to get started?Download WordPress


Two State CSS Button Show Active State (5 posts)

  1. Flash Buddy
    Posted 3 years ago #


    Counseling and advice sought on how to get my buttons to highlight when on the particular page.

  2. without a 'current' state in the code, this is possibly very difficult;

    can you pastebin the full code of your menu?

    are you planning to make a 'current' state of the menu image?

  3. Flash Buddy
    Posted 3 years ago #

  4. you possibly need to use a conditional tag for each button;


    <div id="homeBtn"><a href="<?php bloginfo('url');?>/" title="District Agency Home Page" <?php if( is_home() ) echo 'class="current"'; ?>><img src="<?php bloginfo('template_directory');?>/images/homeBtn-norm.png" alt="Home Button" /></a></div>

    analog for the other menu tabs, with is_page('what-we-do')
    or with is_category('case-study') and so on...


    and add corresponding styles to style.css;

    example (to make the .current look like the hover):
    #who-we-are_btn-2-state_button li a.current { background-position: left -39px; }
    and optional hover state:
    #who-we-are_btn-2-state_button li a.current:hover { background-position: left -0px; }

  5. Flash Buddy
    Posted 3 years ago #

    Giving this a try now...

Topic Closed

This topic has been closed to new replies.

About this Topic