To save time from having to design CSS styles for each and every
element, we can use the inherit property to apply the styles from the
parent element to the child elements. Child elements are elements
contained inside a element which is called the parent elemnent.
For example,
In the above example, p is the child element of div and b is the child element of both p and div.
Let’s examine the following example:
Inheritancein CSS
We have learned about child and descendent selectors in previous lesson.
For example,
I am the child element of div and I
am the child element of p and also a child element of
div
.In the above example, p is the child element of div and b is the child element of both p and div.
Let’s examine the following example:
Example 9.1
We have learned about child and descendent selectors in previous lesson.
In this lesson, we shall learn about
inheritance in CSS
inheritance in CSS
The Output
We have learned about child and descendent selectors in previous lesson.
In this lesson, we shall learn about
inheritance in CSS
inheritance in CSS
0 Comments
Good day precious one, We love you more than anything.