CHAPTER 3 CSS SELECTORS AND INHERITANCE
Visual Inheritance
HTML
<h1>Visual Inheritance</h1>
<div>
<p>
<label>
<span>
- This span is nested inside a label, a paragraph, and a division.
- The division is assigned a background color, padding, and a border.
- Since the span, label, and paragraph default to a transparent background
color and have no border, they "visually inherit" the
background, padding, and border of the division. - Once you assign a background to an element, it no longer visually inherits
the background of its parent—like this<code>
element.