CSS Font property is used to apply font styling on the text, eg. text size, bold, italic, text style, capital letters, small letters, underline, text spacing etc.
Font Property | Possible values | Description |
---|---|---|
font-weight | bold | normal | To change text in bold or unbold. |
font-style | italic | normal | To change text in italic or normal style. |
font-size | 20px; | Font size unit can be in pt, px, %, em, rem, in, cm. Default font-size is 16px. Prefered unit: px, em, rem |
font-family | arial | To change font, mention font name. Prefered sans-sarif fonts. |
font | bold italic 14px arial; italic 14px arial; 14px arial; | Instead of writting separate property you can mentioned above properties in one line |
font-variant | small-caps | normal | To change text in capital letters but text size is small. |
Text Property | Possible values | Description |
---|---|---|
text-decoration | none | underline | overline | line-through | To apply or remove line on text |
text-align | left | center | right | justify | To change the text alignments in a paragraph. |
text-transform | uppercase | lowercase | capitalize | To change the text case. |
Text Spacing Property | Possible values | Description |
---|---|---|
text-indent | 50px | Specifies the indentation of the first line. |
word-spacing | 30px | -30px | Specifies space between words |
letter-spacing | 20px | Specifies space between letters |
line-height | 1.5em | Specifies space between lines |