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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:19:12+00:00 2026-06-14T08:19:12+00:00

Could I get a little help with this CSS? In my stylesheet I have

  • 0

Could I get a little help with this CSS? In my stylesheet I have my anchor colors defined:

a:link {}
a:visited {}
a:hover {}

Later on in the stylesheet, I have some anchors that are within a span defined as:

span.logout {}
span.logout a:link, a:visited {}
span.logout a:hover {}

The only thing is, my anchor colors in the logout span are overriding my primary anchor colors. I am confused as to why this is happening. I thought only the anchors within the “logout” span would be affected by this CSS.

Anyway, if anybody could help out with this, I would appreciate it. Also, am I using the term CSS “subclass” correctly?

Thanks for taking the time to read, and have a great day. 🙂

  • 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-14T08:19:14+00:00Added an answer on June 14, 2026 at 8:19 am

    Your a:visited selector is standing on its own, without being qualified by the span.logout selector, because the comma separates it. In other words, it’s the same as if you had two rules like this, with the same set of declarations:

    span.logout a:link {}
    a:visited {}
    

    This has the effect of overriding your previous a:visited rule even for visited links within span.logout.

    You need to repeat the span.logout selector after the comma for it to take effect only within such span elements:

    span.logout a:link, span.logout a:visited {}
    

    CSS does not have a notion of “subclasses” in that all classes are treated the same, but your use here seems fine. I suppose the term “subclass” would have a clearer definition in something like OOCSS, though, which is but a CSS coding technique.

    I would call your selector a contextual selector, in that you’re applying styles only to visited links in the context of span.logout elements (technically, the space separating span.logout and a:visited is called a descendant combinator).

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

Sidebar

Related Questions

Can I get a little help with this? In a test project, I have
I was wondering if i could get a little help modifying a piece of
Hope to get a little help from you guys. Im using this script when
I could use a little help clarifying this strange comparison when dealing with vector.size()
I could use a little help. I got this program to work right then
was wondering if I could get a little help with a bit of code
Wondering if I could get some advice and direction on this following requirement: Need
Was hoping I could get a bit of a hand on this login that
I was wondering if i could get some help. What i am trying to
I am new to XHTML and I could use a little bit of help.

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.