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
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
AVADHESH PATEL
15-Jun-2013