Results 1 to 2 of 2

Thread: Active sidebar item issues

  1. #1
    Join Date
    Jun 2009
    Posts
    4

    Active sidebar item issues

    I'm having issues with the sidebar on my page

    http://www.brsr.org/

    Two of the menu items, Home and Common Questions, don't stay in their active state after being clicked on and I'm not sure why. Here's what the CSS for the sidebar looks like:

    Code:
    /* sidebar nav */
    #sidebar { width: 183px; float: left; margin-bottom: 25px; margin-top: 10px; }
    #sidebar ul { list-style-type: none; }
    #sidebar li a { padding: 8px 0 8px 8px; width: 95%; display: block; background: url(img/sidebar-li-a.gif) repeat-x 0px 0px; color: #FFF; font-weight: bold; text-decoration: none; }
    #sidebar li a:hover { background: url(img/sidebar-li-a.gif) repeat-x 0px -30px; }
    #sidebar li a:active, #sidebar li .onpage  { background: url(img/sidebar-li-a.gif) repeat-x 0px -30px; }
    #sidebar li a.commerial { background: url(img/commerical-button.gif); color: #ff8400; font-weight: normal; padding-left: 27px; margin-top: 2px; width: 155px; }
    #sidebar li a.commerial:hover { color: #000; }
    Any help would be appreciated. Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    Browsers treat the active state differently. Read this:-
    http://www.wickham43.net/generaladvice.php#links

    Most only show the active state while pressing the mouse button, not afterwards, (ie only while it is active) but IE retains the active state after you use the back button to return to the page you clicked on a link.

    What you want may be focus, which again is treated differently because IE doesn't support focus, using active instead.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •