validation css

S

steve

Hi all

what the validate mean by

a.. Line : 0 font-family: You are encouraged to offer a generic family
as a last alternative
 
S

Steve Pugh

what the validate mean by

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

When you list a set of fonts, eg
font-family: "My Cool Font", Arial, Helvetica, Verdana;

you are encouraged, but by no means required, to end the list with one
of the generic font families:
serif; sans-serif; monospace; cursive; or fantasy

These do not refer to any particular font but to groups of fonts with
similar properties. In the above example the three real fonts are all
sans-serif fonts so we'll assume that My Cool Font is as well and add
sans-serif to the end of the list:
font-family: "My Cool Font", Arial, Helvetica, Verdana, sans-serif;
Now if a browser doesn't have any of the four named fonts it will use
whatever font it does have access to that does belong to the general
type of sans-serif thus preserving some element of the author's
suggested appearance.

See http://www.w3.org/TR/CSS2/fonts.html#propdef-font-family

However there are browser bugs (some older versions of IE sometimes
screw up on serif) and the default choices for some of the families in
some browsers aren't brilliant so whether you choose to follow this
idea or not is up to you.

Steve
 
S

steve

what the validate mean by
When you list a set of fonts, eg
font-family: "My Cool Font", Arial, Helvetica, Verdana;

you are encouraged, but by no means required, to end the list with one
of the generic font families:
serif; sans-serif; monospace; cursive; or fantasy

How do I know which fonts are generic family
Any way this work fine thanks

Thanks
 
B

brucie

How do I know which fonts are generic family

you cant know as the user determines the font they want for each family
unless they leave the fonts at the browser defaults and you cant know if
they've done that either.

if you specify (e.g) font-family:cursive; then you get the look you want
but the actual cursive font used is left up to the visitor the font may
or may not be the same as the one you use but it doesn't matter as the
visitor get the font they prefer while you keep the look you want.
(if they have a cursive font specified for the cursive generic family).
 
N

nice.guy.nige

While the city slept said:
you cant know as the user determines the font they want for each
family unless they leave the fonts at the browser defaults and you
cant know if they've done that either.

[...]

Yay, Brucie! Welcome back! You had us worried...

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. (e-mail address removed). Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
In the land of the blind, the one-eyed man is very, very busy!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top