Why doesn't my site use the Tahoma font?

I have my fonts installed in my .css style:

font-family: "Arial, Verdana, sans-serif";

But my website still uses sans serif. What is the problem?

+3
source share
2 answers

Commas in the CSS CSS font specification must be outside quotation marks.

For example:

font-family: "Arial", "Verdana", sans-serif; /* And you should really 
omit the quotes if it only one word */

Not

font-family: "Arial, Verdana, sans-serif";

Otherwise, the CSS parser thinks you're looking for the font "Arial, Verdana, sans-serif", which clearly does not exist.

+7
source

Try removing the "" from the font family definition:

font-family: tahoma, sans-serif;

Like this. Put it around when you have a few words, such as

font-family: "mutiple word font name",tahoma, sans-serif;     
+3
source

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


All Articles