SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    show/hide active button

    How would I display between two buttons, which is the active button state? Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by yorsite View Post
    How would I display between two buttons, which is the active button state? Thanks
    You would give the active button a class, such as "active" and use CSS to adjust its presentation.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello @paul_wilkins, so I have been using the code (CSS) below, however no dice. Works for hover just fine, but an active button won't stay with the color - rgb(0,0,0). Any ideas?

    Thanks

    a.x{
    background:rgb(252,252,252);
    padding:3px 18px;
    border-radius:7px 7px;
    border:1px solid rgb(204,204,204);
    color:rgb(102,102,102);
    margin:0 12px 0 0!important;
    cursorointer;
    }

    a.x:visited{
    background:rgb(0,0,0);

    }

    a.x:hover{
    background:rgb(153,153,153);
    }

    a.x:active{
    background:rgb(0,0,0);
    }

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    The :active CSS psuedo-class is when the link is clicked on. That is very different from what I was suggesting before.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

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