What is the purpose of using font: inherit?

前端 未结 7 962
醉酒成梦
醉酒成梦 2020-12-25 10:16

I just wanted to know why font: inherit; is used in Cascading Style Sheets.

7条回答
  •  臣服心动
    2020-12-25 10:51

    inherit in CSS simply means it inherits the values from parent element, so for example:

    This text will be Arial..And inherit is default behavior of the browser

    Here

    inherits the font-family: Arial; from it's parent div

    You need to use inherit for example in the case of anchor elements, the color property is commonly set to blue in the user agent style sheet. If you wanted to reinforce the importance of the inherited value, you could use the value inherit in an author or user style sheet, overwriting the user agent style sheet declaration.

    More Reference

提交回复
热议问题