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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:36:19+00:00 2026-06-10T14:36:19+00:00

With this markup: <div id=shopNav> <ul> <li class=active> <a href=#>test 1</a></li> </ul> </div> <ul>

  • 0

With this markup:

    <div id="shopNav">
        <ul>
            <li class="active">
                <a href="#">test 1</a></li>

        </ul>
    </div>  
    <ul>
        <li class="active1"><a href="#">test</a></li>

    </ul>

This doesn’t work

#shopnav li.active {
    border:1px solid red !important;    
}

but:

.active {border:1px solid red !important;}

does work.

I get different behaviours with different doc types:
with

<!DOCTYPE PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

The first one is highlighted in FF and not ie8 and with:

The behaviour is consistant, in that only the second li is given the style.

I don’t understand this at all as I feel like I’ve been using this sort of selector for ages… Why doesn’t the first selector it work in IE9? And why doesn’t the first selector work in either with the loose.dtd ?

See it in action on this page

  • 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-10T14:36:21+00:00Added an answer on June 10, 2026 at 2:36 pm

    The id attribute values are case sensitive. When you have id="shopNav", then in CSS you need to use #shopNav, not #shopnav.

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

Sidebar

Related Questions

I have this markup: <div class=news-listItem> <p class=date>Date: 06.03.2012</p> <h2><a href=#>test aaaaa</a></h2> <div class=news-content>Lorem
I have this markup: <div id=imagedisplay> <div class=slider_item active></div> <div class=slider_item></div> <div class=slider_item></div> <div
I have an href image in this markup. <div class=imgdiv> <a class=imga href=http://destination.com> <img
I have this markup: <asp:Repeater ID=appsRepeater runat=server> <ItemTemplate> <li> <div class=clearfix> <a href=---some code
I have this markup: <div id=myElement> <ul> <li><a href=#1 class=myElementLink>Link 1</a></li> <li><a href=#2 class=myElementLink>Link
I've this markup as <div id=one class=content> <a href=#>a</a> <a href=#>b</a> <a href=#>c</a> </div>
I have this markup: <div id=slider1> <div class=ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all> <a style=left:
After creating a div on the fly with this markup: $('.circuit').prepend(<div class='component' draggable='true'>TRANSISTOR</div>); It
Given this markup: // Calendar.html?date=1/2/2003 <script> $(function() { $('.inlinedatepicker').datepicker(); }); </script> ... <div class=inlinedatepicker
Let's say I have this markup: <div class=foobar> <div style=height:expression(this.parent.style.height + 'px')></div> </div> My

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.