Since font-family is a property of styled content, it would seem logical to apply it to body. The html element represents the whole document (including non-visible metadata), while the body element represents the content of the document. (If a particular element doesn't inherit it, you can always override its font-family property with a value of inherit.)īut what is best practice, and why? That's a bit harder to answer, but I'll have a go. Since every displayed element is a descendant of the body element, and the body element itself is the child of the html element, all elements that inherit the font-family property will happily adopt it from either. In the below-given example, we will define the value of the first font-family property by specifying “ Time new Roman” as font family-name, and “ Times”, and “ serif” as generic family-name.The short answer is, you can use either. Now let’s check out an example of utilizing both family-name and generic family-name as font-family names. You do not have to specify the generic family name in quotes because they are keywords, and their font family names list should end with a generic font family.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |