IE8 Child Selector

Reply

Join Date: Oct 2009
Posts: 12
Reputation: Dat0 is an unknown quantity at this point 
Solved Threads: 0
Dat0 Dat0 is offline Offline
Newbie Poster

IE8 Child Selector

 
0
  #1
Oct 12th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
0
  #2
Oct 12th, 2009
Originally Posted by Dat0 View 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?
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>
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster
 
0
  #3
Oct 20th, 2009
IE sometimes gets confused when you name a class or an id using a tag name.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC