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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:13:36+00:00 2026-05-11T15:13:36+00:00

If I have this CSS: a:link { color: blue; } a:hover { color: red;

  • 0

If I have this CSS:

a:link { color: blue; } a:hover { color: red; } #someID a:link { color: black; } 

Links under the ID always appears in black on hover. I’m aware that using an ID gives a higher priority, however, I’m not overriding the :hover selector, only the :link selector, so shouldn’t the hover display in red?

  • 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. 2026-05-11T15:13:36+00:00Added an answer on May 11, 2026 at 3:13 pm

    The :link pseudo class applies to the link even when you are hovering over it. As the style with the id is more specific it overrides the others.

    The only reason that the :hover style overrides the :link style at all is that it comes later in the style sheet. If you place them in this order:

    a:hover { color: red; } a:link { color: blue; } 

    the :link style is later in the style sheet and overrides the :hover style. The link stays blue when you hover over it.

    To make the :hover style work for the black link you have to make it at least as specific as the :link style, and place it after it in the style sheet:

    a:link { color: blue; } a:hover { color: red; } #someID a:link { color: black; } #someID a:hover { color: red; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this code: $('.access a').toggle(function() { $('link').attr('href', 'styles/accessstyles.css'); $('body').css('font-size', '16px'); }, function() {
I have this script $('head').append('<link rel=stylesheet href=css/file1.css type=text/css />'); $('head').append('<link rel=stylesheet href=css/jquery.jscrollpane.css type=text/css />');
I have a horizontal menu on a page like this <link rel=stylesheet type=text/css href=/classified/siteassets/css/mymenu.css
I have a html like this: <html> <head> <link rel=stylesheet type=text/css media=all href=style.css> </head>
i have this CSS code: h1 { font-size:22px; color:#341C12; font-weight:normal; font-style:italic; } .h1color h1{
This CSS problem is killing me :-( I cannot remove padding under a link
So I have a 4x3 matrix where the red or blue squares are links.
I have this css: a:visited { text-decoration: none; decoration: none; } After a link
I have this css below. Some how my this css's clicked link gets over
I got a css that looks like this: .browse-link A:link { color: #F6CA4C; text-decoration:

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.