You need to style a button differently when it's disabled. Which CSS pseudo-class would be most appropriate to achieve this?

  • :disabled
  • :hidden
  • :inactive
  • :unavailable
To style a button differently when it's disabled, you should use the :disabled pseudo-class. This pseudo-class is specifically designed to target elements that are in a disabled state, such as disabled buttons or form fields. It allows you to apply distinct styles to these elements when they are disabled. The other options, :inactive, :unavailable, and :hidden, do not target disabled elements and are not suitable for this purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *