Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8592495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:45:48+00:00 2026-06-11T23:45:48+00:00

CSS: button:active { /* active css */ } button:disabled { opacity: 0.5; } HTML:

  • 0

CSS:

button:active {
/* active css */
}

button:disabled {
  opacity: 0.5;
}

HTML:

<button disabled="disabled">Ok</button>

When I click the button the browser adds the button:active state making it look like it was clicked (even though it is disabled). I swear I thought :active was only added if the button was enabled. What have I missed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:45:50+00:00Added an answer on June 11, 2026 at 11:45 pm

    From what I can tell, :active doesn’t exclude :disabled elements. You can read the spec if you’d like.

    To solve your problem, you could exclude :disabled elements by targeting only :enabled elements with your :active selector:

    button:enabled:active {
    /* active css */
    }
    
    button:disabled {
      opacity: 0.5;
    }
    

    Demo: http://jsfiddle.net/Blender/LRvra/1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a button to stay active after I clicked it (opacity changed). How
I have a CSS3 button like this <button class="button brownb">My Button</button> CSS .brownb:active {
I have a div with the following CSS class defined: <div class=ui-button ui-state-active>bla bla
I am trying to create a CSS theme switcher button like below. The top
I've created a button using HTML/CSS and a Java script. The button should direct
I want to style the :active state of a button that is represented by
On Firefox, my css-styled buttons (rounded, with tiny icon before the button text) look
In my CSS I tried to mask a button's look by adding a background
Trident <=9 seems to append something like an inner-padding to active button elements. Is
I have a css rule like this: .foo:active { background-position: 0px -382px; } .foo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.