Avatar of Rohit Bajaj
Rohit Bajaj
Flag for India

asked on 

What is font-family

I came across the following font-family in a css rule :
	/* Font */
	font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
	font-size: 12px;

	/* Text color */
	color: #333;

	/* Remove the background color to make it transparent */
	background-color: #fff;

	margin: 20px;

Open in new window

what does it mean by specifying font-family as      font-family: sans-serif, Arial, Verdana, "Trebuchet MS";

As i read sans-serif is a generic family.... and if the browser supports it will this only be applied and rest of them being ignored totally ?
Also on https://developer.mozilla.org/en/docs/Web/CSS/font-family
its mentioned that : A generic font family should be the last item in the list of font family names
why is that so ?


Avatar of undefined
Last Comment

8/22/2022 - Mon