Browser Font Size

Say, if I set the font-familypage body to font1, font2, font3, and then I set the tag h1 font familyto font4, font5. If font 4 and 5 were not installed, would the browser try to execute font 1,2 and 3 before using the default browser font?

+3
source share
3 answers

No, because when you specify font-family, the font stack does not get inherited from the parent element and then is added to. You give it a whole new font stack, separate from its parent element.

If you want the browser to use the first three fonts for <h1>, you need to indicate that:

body { font-family: font1, font2, font3; }
h1 { font-family: font4, font5, font1, font2, font3; }

, CSS font-family:)

+5

:

. , , . , , .

, . , , Firefox, :

<body>
    <p>Hello</p>
</body>

body {font-family: Arial;}
p {font-family: Quill;}

Quill, Arial. , , p , Arial.

, , , :

body {font-family: Arial;}
p {font-family: Quill, Arial;}

, :

p {font-family: Quill, inherit}
p {font-family: Quill, default}

- , , , , . CSS , . , . - , w3C?

+4

No. By default, the browser will be the default.

+2
source

Source: https://habr.com/ru/post/1763754/


All Articles