How to apply a backup font?

body {
font-family: 'Ubuntu', sans-serif;
}

body {
font-family: sans-serif; 
}

Now this is my CSS. I read that if you put a second spare font, it will only be used on devices that do not have your first font.

However, on my laptop, he wants to show the backup font (he reads the first font when the backup comes out of my CSS). How to apply a backup font without doing it - my page?

+4
source share
3 answers

Remove the second block.

You already define it sans-serifas a reserve. If you want to add another font, such as Arial, just add it to the comma-separated list:

body {
    font-family: 'Ubuntu', Arial, sans-serif;
}

, Ubuntu , Arial. Arial , sans-serif .

, , sans-serif , .

+7

, CSS, :

body {
    font-family: Ubuntu, Arial, 'Your font', sans-serif;
}

, , . body . font-family MDN.

0

body/font-family , , .

, ('Ubuntu', Arial, sans-serif;).

0

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


All Articles