Font Shorthand.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under CSS 3 category on | Points: 40 | Views : 296
Syntax:-
body 
{
font: font-style font-variant font-weight font-size/line-height font-family;
}


Example:-
body 
{
font: italic small-caps normal 13px/150% Arial, Helvetica, sans-serif;
}


We need to supply at least font-size and font-family for the shorthand to work,otherwise it will just be a syntax error and do nothing.

body 
{
font: italic 20px Serif; /* works */
font: 20px; /* fails */
font: 18em Fantasy; /* works */
font: bold small-caps; /* fails */
}

Comments or Responses

Login to post response