- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
inheritance
May 23, 2016
Inheritance in CSS is the mechanism through which certain properties are passed on from a parent element down to its children.
Inheritance lets us declare properties on high-level elements and allows those properties to trickle down to all descendant elements.
Inheritance is employed to help reuse existing code with little or no modification.
For example, if you set the body tag of a page to a specific font, that font will be inherited by other elements, such as headings and paragraphs, without you having to specifically write as much.
Every element in an HTML document will inherit all inheritable properties from its parent except the root element (html), which doesn’t have a parent.