Quicky - IE7 CSS - adjacent and sibling selectors

Soldato
Joined
18 Oct 2003
Posts
19,415
Location
Midlands
Just a quicky really,

I was using the following:

PHP:
h2#popularposts + ul > li {
styles
}

For:

PHP:
<h2 id="popularposts">Popular Articles</h2>
<ul>
<li> etc

This worked fine in new browsers. Did a cross check on IE7 and it wasn't applying the styles to the list elements. Not a problem, I labelled the unordered list and changed the selector, but just wondering why it didnt work? Another fun IE7 bug or have I done something wrong.
 
There's comments elsewhere on the page, but nothing between the markup that would break the selectors.
 
Do you have a doctype declared?
Strict 1.0 at the mo.
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
Yeh, as far as I could tell.. it should work. IE7 should listen to adjacent and sibling selectors.. one to watch out for.
 
Back
Top Bottom