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

The Archive Base Latest Questions

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

Wait! This isn’t just another how do you change the font color when the

  • 0

Wait! This isn’t just another “how do you change the font color when the mouse hovers over an image/text/etc.?”

I think I can do this as a hack (by inlining the style for each piece of text), but I’ve heard that style should be separate from content. I’m fighting my hacky programmer routes and trying to become more disciplined. So I’m here to ask for the best way to do this.

I have a simple menu of links on a website I’ve made, and I’d like them to be black font (when the mouse isn’t hovering over) and then change to a color when the mouse hovers. But I’d like each to turn a different color when the mouse hovers over it.

Should I name a style for each of these colors and then declare a div when each is used? That seems almost the same as inlining the style.

I’d really appreciate your sage advice on how to do this the right way!

  • 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-24T23:30:29+00:00Added an answer on May 24, 2026 at 11:30 pm

    CSS:

    <style type="text/css">
        a { color: black; }
        a:hover { color: grey; }
        a.green:hover { color: green; }
        a.red:hover { color: red; }
        a.blue:hover { color: blue; }
        .content a:hover, .content a.green:hover, .content a.red:hover, .content a.blue:hover { color: yellow; }
    </style>
    

    HTML:

    <a href="#" class="green">green link</a>
    <a href="#" class="red">red link<a>
    <a href="#" class="blue">blue link</a>
    <a href="#" >grey link</a>
    
    <div class="content">
        <a href="#" class="green">yellow link</a>
        <a href="#" class="red">yellow link<a>
        <a href="#" class="blue">yellow link</a>
        <a href="#" >yellow link</a>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On several of my usercontrols, I change the cursor by using this.Cursor = Cursors.Wait;
Will this code ever wait on the mutex inside the producer's void push(data) ?
Is there a problem with this type of implementation to wait for a batch
I basically need to show a wait window to the user. For this i
I need a way to wait until a (Swing) JComponent is fully painted. This
I'm trying to decode the result of the Python os.wait() function. This returns, according
Thread 1: if(!conditionFullfiled) this.wait(); Thread 2: if(conditionFullfiled) thread1.notify(); I want to wake up thread
Unfortunately, the answer to this question isn't quite as simple as it sounds... but
Code: final ProgressDialog pd = ProgressDialog.show(Main.this,,Loading. Please wait..., true); pd.show(); Thread t = new
hi this function downloads an image from source and adds it to a zip

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.