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

  • Home
  • SEARCH
  • 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 8137871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:18:23+00:00 2026-06-06T11:18:23+00:00

Any one know how to apply a css propert to the a tag, but

  • 0

Any one know how to apply a css propert to the a tag, but only when it’s in a certain div? I would like the .router_li div to have the hover effect, but any other links. I’m not sure what this is called.

I think it’s called a pseudo class, and I’m not doing it right.
I tried this:

a:router_li:hover{
  background-color:yellow;
  width: 200px;
  height: 60px;
  background-color: #2c5fac;
  border: 1px;
  border-color: #FFFFFF;
  border-top-right-radius: 8px;
  border-top-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  border-style:solid;
  border-width:1px;
  color: white;
}
  • 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-06T11:18:25+00:00Added an answer on June 6, 2026 at 11:18 am

    IDs, classes and pseudo-classes are different things, and CSS has different notations for all three:

    • ID selector
    • Class selector
    • Pseudo-class

    If you want to apply this particular :hover (which is a pseudo-class) only when a is a div with class router_li (as in <div class="router_li">), use

    .router_li a:hover
    

    That’s a class, though; if it’s an ID (as in <div id="router_li">), use

    #router_li a:hover
    

    In both cases, router_li is not a pseudo-class since it is defined in the markup and not in CSS, so the :router_li in your code is invalid. Also notice that the ID/class (whichever it is) comes before the a:hover – this is called a contextual selector (a only when it’s in a certain div).

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

Sidebar

Related Questions

I do not know if is possible in CSS, but I would like a
Does any one know why the location indicator stay on for certain bundle identifer
does any one know how to make the slide to left effect like in
I want to apply a CSS rule to any element whose one of the
Would anyone one know if Apple has restrictions on providing a user feedback/bug report
Does any one know in which programming language were Google Talk application developed. yes
Does any one know what is the exact usage of xmlns in HTML, XML
Does any one know if there is kinda implementation/addon for VS 2008 SP1 for
Does any one know when Microsoft intends to stop supporting Visual Studio 2002?
Anyhow, I have a problem. A tiny problem I suppose, but one that's bugging

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.