View Full Version : attribute inheritance
03-01-2005, 11:50 PM
Hello, I am relatively new to Web design, and I have a question.
Where can I find what attributes are not inherited from parent to child? For instance, when applying a style to the <body> tag, the <h#> tags will inherit mostly everything but size. Why is this, and what determines it? I would like to know wherelse this applies.
Thank you in advance for any help.
Good question - I would like to know as well so... :)
I found these links by searching on google with the keywords "css inherit"
http://msdn.microsoft.com/workshop/author/behaviors/overview/viewlink_ovw_css.asp (IE specific)
These are but a few of the many hits I got with that search.
Thanks for asking this as I have bookmarked these myself.
03-02-2005, 12:50 AM
I think the general answer is that default browser settings are nothing more than built-in stylesheets (in a way). So the usual rules of specificity apply.
As far as I know, hx elements are controlled by percentage, not specific pixels, so if the font-size set in body was, say 10px, a h2 element would be smaller than if the font-size in the body was set to 12px.
The same goes for uls and lis-- the font sizes displayed are relative to the size set in the body. Don't forget tables and tds, whose fonts need to be redeclared completely in IE.
Those are the general rules I'm aware of... looking through some of those links above might help to get a deeper understanding.
03-02-2005, 03:24 AM
Thanks for the quick response guys. I looked into the links and it makes much more sense now.
03-02-2005, 08:40 AM
The W3C candidate recommendation for CSS 2.1 (http://www.w3.org/TR/2004/CR-CSS21-20040225/) features a list of all properties (http://www.w3.org/TR/2004/CR-CSS21-20040225/propidx.html); it also tells which properties are inherited and which are not (column 5, "Inherited?").
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.