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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:38:45+00:00 2026-06-17T22:38:45+00:00

HTML <ul> <li><a href=#>Home</a></li> <li><a href=# class=active>About</a></li> </ul> CSS ul li:nth-child(even) a { text-shadow:

  • 0

HTML

<ul>
  <li><a href="#">Home</a></li>
  <li><a href="#" class="active">About</a></li>
</ul>

CSS

ul li:nth-child(even) a {
    text-shadow: 1px 1px 1px red;
}

.active {
    text-shadow: none;
}

And second list item still have shadow. why?

  • 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-17T22:38:46+00:00Added an answer on June 17, 2026 at 10:38 pm

    it’s a matter of specificity: the first rule wins because it has a bigger specificity (calculated as 1 pseudoclass and 3 elements: 13) than the second (1 class only, no elements: 10) : you should write instead

    ul li:nth-child(even) a.active {
       text-shadow: none;
    }
    

    or – in general – any other valid rule with a specificity greater or equal than 13.

    If you cannot change the second selector you may simply use !important applied on the property, but its use should be limited as less as possible.


    For further information, see also:

    • this reference about the specificity (MDN);
    • this article on Smashing Magazine about the specificity and how to calculate it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML bellow: <ul class=tabs> <li><a href=#doc-new>Home</a></li> <li class=active><a href=#doc-fav>Profile</a></li> <li><a href=#doc-read>Messages</a></li>
I have some nav links like so: <ul id=nav> <li><a href=index.html>Home</a> <li><a href=about.html>About</a> <li><a
HTML: <ul class=nav nav-tabs> <li><a href=#home data-toggle=tab>Home</a></li> <li><a href=#profile data-toggle=tab>Profile</a></li> <li><a href=#messages data-toggle=tab>Messages</a></li> <li><a
I run it on: @Html.ActionLink(TEST, About, Home, null, new { @class = openDialog, data_dialog_id
Here is my code so far, <html> <head> <title></title> <link rel=stylesheet type=text/css href=http://o.aolcdn.com/dojo/1.1/dojo/resources/dojo.css />
there is a script in my html tag <script type=text/javascript> function setTaxDisplay(display) { window.location.href
The example I have in HTML: <div id=red-nav-warp> <ul id=red-nav-logo> <li><img class=sponsors id=sponsorone src=media/img/logosmall.png
hi i have an html snippet as below:- <ul id=userTabs class=clearfix> <li class=selected><a href=>Profile
I am trying to write a RegEx rule to find all a href HTML
I'm using Saxon 9 to analyze invalid html sources. Specifically the html has href

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.