import font family

admin

Administrator
Staff member
I used the css validator (<!-- m --><a class="postlink" href="http://jigsaw.w3.org/css-validator/check/referer">http://jigsaw.w3.org/css-validator/check/referer</a><!-- m -->) to test some of my css and it passed, however, could someone please explain the results I got. I'm not sure what they mean by offering a generic family as a last alternative. How would one do that?


Line : 7 font-family: You are encouraged to offer a generic family as a last alternative


Valid CSS information



@font-face {

font-family : '"silkscreen"';
src : url("slkscr.ttf");
font-style : normal;
}
}
body , td {
font-family : silkscreen;
font-size : 8px;
}Not everybody has the same fonts. You are encouraged to you fonts that people have and use, such as Arial.Thanks for the speedy response. but my question is *how* do I add additional fonts. would it be like this?



@font-face {

font-family : '"silkscreen"';
src : url("slkscr.ttf");
font-style : normal;
}
}
body , td {
font-family : silkscreen, Arial, Verdana;
font-size : 8px;
}yup just put a comma and the next font.thanks Yoda!No problem, silent.WOW - the problem I got now is that the font I want to use! The .ttf is 14MB!!!! I've never seen that before. Will each client have to load the full ttf locally before they can render the font???If they do not have the font on their computer they will.Thanks again! I'll have to find an alternative font then =)The generic font family refers to either 'serif' or 'sans-serif'. Arial is not generic. It is a specific 'sans-serif' font. What you want to use is:

font-family : '"silkscreen, sans-serif"';

Not sure how the extra single quote affects things. I'd be using just the double quotes: "Not sure how the extra single quote affects things. I'd be using just the double quotes: "



Yes, you're right about the double quotes. I think the validator put single quotes around the double quotes to identify where correction needed to be made.

Thanks for the serif insight. that helps.I think it should actually be:

font-family: 'silkscreen', 'arial', sans-serif;

Basically quotes around specific font names, and the generic alternative without quotes.Well that's news to me. I always thought that you would only have to comma the fonts not known in commmon sets. Anyway, if you have any trouble, have a ganders at this w3 fonts (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/fonts.html#font-family-prop">http://www.w3.org/TR/REC-CSS2/fonts.htm ... amily-prop</a><!-- m -->)

Best Wishes,
DavidQuotes (single or double) are only required for multi-word font names:
font-family : "Times New Roman", Times, serif;

Check Embedding fonts (<!-- m --><a class="postlink" href="http://hotwired.lycos.com/webmonkey/design/fonts/tutorials/tutorial2.html">http://hotwired.lycos.com/webmonkey/des ... rial2.html</a><!-- m -->)Well i'll be darned. We posted in exactly the same minute. Well what you have said certainly explains it.

Best Wishes,
David
 
Back
Top