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 6349905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:42:30+00:00 2026-05-24T21:42:30+00:00

I currently have the following CSS: a.enabled:hover { background-color: #f9f9f9; border: 1px solid #ddd;

  • 0

I currently have the following CSS:

a.enabled:hover { background-color: #f9f9f9; border: 1px solid #ddd; }

Code:

<div><a class="enabled" ......>07</a></div>
<div><a class="enabled" ....... >08</a></div>
<div><a class="disabled" >09</a></div>
<div><a class="enabled" ...... >10</a></div>
<div><a class="enabled" .......>11</a></div>

When I hover over an “enabled” link then the background color changes. When I hover over a “disabled” link then nothing happens.

I would like cut down on the size of my page by removing all the class=”enabled” text that appears on so many lines (more than 200). Something like this.

After:

<div><a  ........>07</a></div>
<div><a  ....... >08</a></div>
<div><a class="disabled" >09</a></div>
<div><a  ...... >10</a></div>
<div><a  .......>11</a></div>

Is there a way I can do this with CSS? I just want the hover not to change the background-color if the link has a “disabled” status.

  • 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-05-24T21:42:31+00:00Added an answer on May 24, 2026 at 9:42 pm

    The selector you will use is

    a:not(.disabled):hover { background-color: #f9f9f9; border: 1px solid #ddd; }
    

    The trade-off is browser compatibility – IE < 9 does not support :not(). As a workaround you can use an override rule with these two rules instead, if you can define a default background color:

    a, a.disabled:hover { /* Default background and border */ }
    a:hover { background-color: #f9f9f9; border: 1px solid #ddd; }
    

    … or just stick to your existing .enabled and .disabled solution.

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

Sidebar

Related Questions

I currently have a CSS <ul><li> dropdown menu that uses the following code. Unfortunately
I currently have the following CSS for my 4 columns which might grow to
I currently have the following js code function clearMulti(option) { var i; var select
currently I have the following code: String select = qry.substring(select .length(),qry2.indexOf( from )); String[]
I currently have code that does the following: private final static ExecutorService pool =
I have the following CSS: body { margin-left:0px; margin-right:0px; margin-bottom:0px; margin-top:0px; background-image: url(../images/tile.png); background-repeat:
I have the following html and css <div id=header> <div id=headerTopLeft> <div id=areaSelect style=display:
I am currently styling an <input type='button'/> element with the following CSS: background: transparent
I have the following HTML/CSS: #scrollpanel{height:100px;overflow-x:hidden;overflow-y:scroll;width:200px} <div id=scrollpanel> <div class=listing ref_1>...</div> <div class=listing ref_2>...</div>
I currently have the following in my HTML document. <link REL=StyleSheet HREF=/stylesheets/home.css TYPE=text/css MEDIA=screen>

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.