[thelist] [CSS] Specificity Issues

Scott Schrantz scotts at rci-nv.com
Mon Oct 21 18:36:01 CDT 2002

> -----Original Message-----
> From: Dru and Cindy Sellers [mailto:dru at zetachi.org]
> <html>
>   <body>
> 	<div>111
>           <div>222
>             <div>333</div>
>           </div>
>         </div>
>   </body>
> </html>
> How can I spwcify only one child level deep with css? I want
> both the "111" and the "222" to have a margin and the "333"
> to not have a margin. Any ideas?

1. body div{} would affect all three of them
2. body>div{} would affect 111
3. body>div>div{} would affect 222
4. body>div>div>div{} would affect 333

Only #1 works in IE. Underline that, put it in bold, and staple it to your
forehead. IE doesn't understand the child selector (>), making it almost
useless for practical use. Actually, its greatest use currently is as a hack
to hide styles from IE.

Scott Schrantz
work: www.rci-nv.com
play: www.computer-vet.com

More information about the thelist mailing list