Neerav,
Does anyone know of a definitive guide to CSS inheritance, hopefully including which tags inherit properties from other tags eg: <p> inherits from <body>
its an interaction of HTML and CSS.
Some properties in CSS are inherited, others are not.
See the spec, or westciv's guide as to whether a specific property is inherited.
Why are some not inherited? Imagine for a moment that margin was inherited.
Say body had a 1em margin. Then all the children of the body would have a 1em margin, all the children of those children, and "so on ad infinitum".
You can however, specify that a property be inherited in CSS, for any CSS property (if memory series me correctly, but there may be a small number of exceptions to that)
As far as I am aware, the children of an element inherit all its inheritable properties. The proviso would be that where a property is restricted to say only block level elements, then its inline children would not inherit such properties.
This bit is just unchecked conjecture.
HTH,
john
John Allsopp
:: westciv :: http://www.westciv.com/ software, courses, resources for a standards based web :: style master blog :: http://westciv.typepad.com/dog_or_higher/ :: WebEssentials Sept 2004 Sydney Australia :: http://www.we04.com
****************************************************** The discussion list for http://webstandardsgroup.org/
Proud presenters of Web Essentials 04 http://we04.com/ Web standards, accessibility, inspiration, knowledge To be held in Sydney, September 30 and October 1, 2004
See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************