views:

20

answers:

1

I am getting really weird behavior, it seems like IE8 is not handling the child selector in CSS correctly. Consider the following:

<html>
  <head>
    <style>
    ul>li {font-style: italic}
   </style>
 </head>
 <body>
 <ul> <li>Hello </li> </ul>
 </body>
 </html>

This displays Hello in italics on FF, but not on IE8. If you change the selector to:

ul li {...}

It displays italic in both browsers.

Where am I going wrong?

+2  A: 

IE8 can and should be displaying this CSS declaration correctly. Check your Compatibility View settings and confirm that you're not rendering the page in IE7 mode.

Phil.Wheeler
Press F12 to check what is your rendering mode (IE7 or IE8).
Jeaffrey Gilbert