What is the inherit and initial of the CSS for?

Asked

Viewed 676 times

0

As the title itself says, what’s the point of inherit and the initial that has in the CSS?

1 answer

6


Inherit

Inherit simply means that the style will be inherited from the parent element.

According to the own W3C the Inherit:

Specifies that a property should inherit its value from its parent element. The word inherit can be used for any property CSS, and in any element HTML.

You can read more about the Inherit here.

Initial

Initial denotes the initial value of the property as defined in CSS specifications:

Represents the specified value that is designated as the initial value of the property. The initial word can be used for any property CSS, and in any element HTML.

Briefly, Initial is used to set the property CSS as its default value.

You can see an example of Initial here.


I formulated the answer based on in that and in that issues of the OSen, and used free translation in some quotes.

  • 1

    This is one of the cases where the answer to a dup question is better than the answer to the first +1 question

Browser other questions tagged

You are not signed in. Login or sign up in order to post.