944,047 Members | Top Members by Rank

Ad:
Oct 12th, 2009
0

IE8 Child Selector

Expand Post »
Hi! I read that IE 8 accepts child selectors. But it does not seem to work for my IE8 (Spanish version if this even matters).

HTML and CSS Syntax (Toggle Plain Text)
  1. #div > p{background-color: blue;}
  2. ========================
  3. <div id="div">
  4. <p>Shoud work here!</p>
  5. <div>
  6. <p>and not here</p>
  7. </div>
  8. </div>

It works for firefox and not for internet explorer. What could be happening?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Dat0 is offline Offline
12 posts
since Oct 2009
Oct 12th, 2009
0
Re: IE8 Child Selector
Click to Expand / Collapse  Quote originally posted by Dat0 ...
Hi! I read that IE 8 accepts child selectors. But it does not seem to work for my IE8 (Spanish version if this even matters).

HTML and CSS Syntax (Toggle Plain Text)
  1. #div > p{background-color: blue;}
  2. ========================
  3. <div id="div">
  4. <p>Shoud work here!</p>
  5. <div>
  6. <p>and not here</p>
  7. </div>
  8. </div>

It works for firefox and not for internet explorer. What could be happening?
What DTD are you using? Might require STRICT mode.
But if you are working in a strict document than it will mean it doesn't support direct child selector syntax.

But this is a highly effective workaround - try this.
HTML and CSS Syntax (Toggle Plain Text)
  1. <style type="text/css">
  2. #div p{background-color: blue;}
  3. #div div p{background-color: transparent;}
  4. </style>
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
511 posts
since Jun 2008
Oct 20th, 2009
0
Re: IE8 Child Selector
IE sometimes gets confused when you name a class or an id using a tag name.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: How important are robots.txt file?
Next Thread in HTML and CSS Forum Timeline: positioning problems





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC