On 12/19/07, Ian Wienand <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Can someone explain to me why the HTML/CSS below seems to allow some
> attributes of the H1 within the class to change, but not others?
Hi,
It's a precedence issue - div#maindiv h1 is being applied after
div.aclassh1. If you remove the color attribute from div#maindiv h1
you'll see that
the first header is black, and the second blue.
I'm not sure what you are trying to do, so I can't really suggest a
solution!
Rob.
I see two lines, the second one is centered as I expect but is still
> red, not blue. So it seems the selector is matching the second H1,
> but the color attribute is not being applied?
>
> Thanks,
>
> -i
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <style type="text/css">
> div#maindiv h1 { color: #FF0000 }
>
> div.aclass h1 { color: #0000FF;
> text-align: center;
> }
> </style>
> </head>
>
> <body>
>
> <div id="maindiv">
> <h1>Main div H1</h1>
>
> <div class="aclass">
> <h1>Aclass H1</h1>
> </div>
>
> </div>
>
>
> </body>
> </html>
>
> _______________________________________________
> coders mailing list
> [email protected]
> http://lists.slug.org.au/listinfo/coders
>
--
Rob S
* Sponsor my mo! *
- Pic: http://urltea.com/23ui
- Cashmoney: http://urltea.com/20ii
This email is: [ ] bloggable [X] ask first [ ] private
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders