Home Advertise with us Forum Articles Sitemap Contact

CSS Font

Just like a Microsoft Word application, it is possible to execute a control over the way your text be displayed using CSS. It allows you to change the fort of your text with respect to color, size, style & more. CSS Font Family

The font families in CSS can be divided into two groups – serif & sans-serif. While the serif font includes small lines at the end of characters, sans-serif doesn’t. Also, the sans-serif fonts are easily readable on the computer monitor. It is advisable for the font family to have several font names, in case the browser fails to support any font.

Example: h1 {font-family: sans-serif;}
CSS Font Size

The CSS “font size property” allows modifying the size of the font using percentages, values or key terms. Values are useful when you wish to restrict the user from being able to change the size of the font in the browser. Percentages are useful for modifying the default font without setting an absolute value.

Example: p {font-size: 120%;} or h4{font-size: 10px;}

CSS Font Color

The CSS "font color property" is used to set the color of the font either using generic names, RGB or hexadecimal notations.

Example: h1 {color: #9000A1;} or h1 {color: red;} or h1 {color: rgb(0, 220, 98);}

CSS Font Variant

The CSS "font variant property" is used to convert the font to all small caps.

Example: p {font-variant: small-caps;}