Some styles, like font family, text-alignment etc., are automatically inherited by child elements from their parent element (i.e. by an element contained inside another one).
Others are not automatically inherited.
Example
<div style=”font-family:serif; border:1px solid red; padding:10px;”> This text will be in a serif font. <p> This text is also in a serif font, because font is inherited by default. But the border and padding properties are not inherited from the parent div. </p> </div>
Liked By
Write Answer
Inheritance in CSS
Join MindStick Community
You have need login or register for voting of answers or question.
AVADHESH PATEL
15-Jun-2013