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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:03:27+00:00 2026-05-30T10:03:27+00:00

I came across this issue when testing a stylesheet across different browsers, including IE6

  • 0

I came across this issue when testing a stylesheet across different browsers, including IE6 (yes, I know..)

<head>
<style>
  a:link, a:visited, a:hover, a:active { font-weight: bold; color: #000; text-decoration: underline }
  .myclass a { color: red; text-decoration: none; }
</style>
</head>
<body>
<p>This is a <a href="1">test</a></p>
<div class="myclass">
<p>This is a <a href="2">test</a></p>
</div>
</body>

Results:

  • In IE6, the .myclass a rule only applies to the unvisited link state
  • In other browsers (FF, Chrome), the .myclass a rule applies to all link states

I believe that IE6 is wrong and that .myclass a, with no pseudo-classes specified, should apply to all link states. However I came across this SO question where it says that a is equivalent to a:link. This would match the behaviour in IE6. However I cannot find any official reference confirming this.

Which one is right?

Update:

As noted in the comments, the accepted answer to the question referenced above has since been updated.

  • 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-30T10:03:28+00:00Added an answer on May 30, 2026 at 10:03 am

    The other browsers are right; IE6 is wrong.

    The selector a should match any <a> elements, while a:link only matches <a> elements that are unvisited hyperlinks (the HTML 4 document type defines hyperlinks as <a> elements with a href attribute). Nowhere does it state in either specification that a should automatically translate to a:link or vice versa.

    Since there’s no such translation going on, your two CSS rules have equally specific selectors (your class selector shares equal specificity with each of your pseudo-classes). So, your second rule is supposed to override the first rule for any <a> elements within div.myclass, regardless of their link state, thereby making it always red and with no text decoration.

    By the way, IE7 also fails to apply the font-weight: bold style when you test with an <a> element in div.myclass that isn’t a link, even though it’s supposed to as there is no overriding font-weight style in your second rule:

    <div class="myclass">
    <p>This is a <a href="2">test</a></p>
    <p>This is a <a>test</a></p> <!-- does not bold on hover in IE7! -->
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While researching the issue of JSON vs XML , I came across this question
I came across an issue when I was testing my HTML Helper. Basically I'm
While debugging a crash, I came across this issue in some code: int func()
I came across this issue recently and thought it was really helpful. My question
While debugging a WCF service I came across this issue. I use an HttpURLConnection
While writing some code i came across this issue: #include <iostream> class random {
I'm roughing a layout together and doing some browser testing. Never came across this
I'm using iText to generate PDF reports when I came across this issue, and
We just came across an interesting issue which we face during unit testing of
I've been fiddling with flash lately and I came across this issue. I've noticed

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.