0
Is number 1 in correct format? I collect it from MDN.
font-family: Gill Sans Extrabold, sans-serif; font-family: "Goudy Bookletter 1911", sans-serif;
7 odpowiedzi
+ 2
According to MDN the first one is valid. But, w3.org recommends to quote font family names that contain white space, digits, or punctuation characters other than hyphens:
+ 2
When you're unsure use this
https://jigsaw.w3.org/css-validator/#validate_by_input
Copy and paste this to check validation
p {font-family: Gill Sans Extrabold, sans-serif; font-family: Goudy Bookletter 1911, sans-serif;}
then this
p {font-family: Gill Sans Extrabold, sans-serif; font-family: "Goudy Bookletter 1911", sans-serif;}
+ 1
Both declarations are valid
"Font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. This means that punctuation characters and digits at the start of each token must be escaped in unquoted font family names." - MDN
+ 1
These are the guys who make the standards. https://www.w3.org/TR/CSS2/fonts.html
+ 1
Chris C. Thanks
+ 1
Chris C. Maybe quated format is more valid, I use this. Validators shows no warning.
0
Chris C. But why it is invalid?
font-family: Goudy Bookletter 1911, sans-serif;
can you please make some explanation?