Design of font style property by CSS
Fonts are important part of our html page. We can manage the style property of our fonts using style sheet. We will use internal style sheet to set the property values of our fonts. We will discuss each font property here and its possible values. At the end you can see the demo and html code of the style sheet used.
Font FamilyLet us start with font type or family by saying what style of font to be used. We can use any supported font. Here is how we will set the font family using CSS.
Font StyleWe will try to set the font style by using font-style property.
It can take values as normal, italic and oblique
Font WeightWe will set the weight of the font. We can have values
100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | normal | bold | bolder | lighter
Here is one example on how to set font-weight
Font SizeWe can set relative or absolute font size for the text.
Font variantWe can be used to display fonts in two options one is normal and other is SMALL-CAPS
With small-caps all fonts will be displayed in upper case ( capital letters ) and with upper case letter in slightly higher in height.
We can adjust the gap between lines ( line spacing ) by using line-height.
We can combine all above internal styles in to one declaration and keep it inside the page. Same code we can use for CSS also. Now here is the total style code
This article is written by plus2net.com team.