Why only fonts that marked in yellow color are within quotes?


#1

why in css font family only the fonts that marked in yellow are within quotes(single quotes)?
thanks in advance.


#2

Hi there,
It's very simple, the double or single quotes are used when the name of the FONT, or the name of the FONT FAMILY have spaces in their names... and that's the explanation basically. It doesn't affect if there are single or double quotes, but if you open with a single quote, then you close with single quote, and the same for the double quotes.

Let's see some examples:

h1{
font-family: "Gill Sans Extrabold", Helvetica, sans-serif;
 }

Where:
* "Gill Sans Extrabold" - Is the name of the font, see how it has spaces in its name.
* Helvetica - is the name of the name font family, it's a single word.
* sans-serif - is the generic name of the font family, this one doesn't have any spaces in its name, so no double quotes either.

p {
font-family: Courier, "Lucida Console", monospace;
 }

Where:
* Courier - Is the name of the font, now here it's a single word.
* "Lucida Console" - is the name of the name font family, see how there are spaces in its name.
* monospace - is the generic name of the font family, no spaces founded, no double quotes either.

h2 {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

Where:
* "Lucida Sans Unicode" - Is the name of the font, there are spaces in its name, so there are double quotes.
* "Lucida Grande" - is the name of the name font family, see how there are spaces in its name, and we need the double quotes too.
* sans-serif - is the generic name of the font family, no spaces founded, no double quotes.

Hope the question was answered.


#3

Thenk you so much for taking your time and explaining it to me!


#4

You're welcome :grin:

And they are in yellow because of the markup "style"... that depends on the text editor you are using, and the theme you apply to that text editor, BTW.


#5

that depends on the text editor you are using, and the theme you apply to that text editor,


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.