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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:39:45+00:00 2026-06-07T09:39:45+00:00

Hopefully this isn’t a stupid question but I can’t seem to work out how

  • 0

Hopefully this isn’t a stupid question but I can’t seem to work out how to do this. Can you apply a wildcard to an anchor hover/focus so that the style is applied to all classes?

Something like

a:hover * { color: #ff0000; }

Say I have

a { color: #DD0000; }
a.link { color: #ffffff; }
a.link2 { color: #000000; }
a.user { ...
a.anything { ...

The easiest way to explain what I’m looking for is to have a global :hover style, but multiple :link styles.
Thanks

  • 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-07T09:39:48+00:00Added an answer on June 7, 2026 at 9:39 am

    There are a number of ways you can do this. As mentioned by others, you can apply the same style to multiple classes like so:

    div a.class1:hover, div a.class2:hover, div a.class3:hover { ... }
    

    You can also create a custom class just for the style you want to apply:

    div a.customClass:hover { ... }
    

    You could use * like you mentioned in the question, but apply hover to it:

    div *:hover { ... }
    

    There’s also this option, where you just apply the style for all a‘s, although you probably know about this option already:

    a:hover { ... }
    

    Edit: If your style is being “overwritten” by something else, a quick and easy way to check would be to use your browser’s developer tools to inspect the element. You can even apply pseudo-classes (ie. apply :hover pseudo-class even when you’re not hovering over the element) with the developer tools included with Chrome and Firefox (you may need to download Firebug to do this with Firefox).

    Another option would be to use !important to increase the selector’s specificity. For example:

    a:hover { background: red !important; }
    

    You can read more about how the specificity is calculated here.

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

Sidebar

Related Questions

Hopefully this is just a stupid mistake, but I can't see it. ; OK
This isn't a very simple question, but hopefully someone has run across it. I
Hopefully this isn't a dupe of another question, but I couldn't see it anywhere
I apologize if this isn't the best place to ask this question, but hopefully
Hopefully this isn't too specific/small a question, but I was wondering if anyone knew
This isn't strictly a programming question, but hopefully someone here has the knowledge to
Hopefully this isn't too stupid but I want to make sure I'm doing this
Hopefully this isn't a repeat question, but if it is, just post the link
Hopefully this question isn't as subjective as I think it may be. I have
Hopefully this is an easy question. How can I define an XML type such

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.