CSS styles for text formatting
Text formatting styles define the layout of text and include text properties and their possible values in the form property: value;. They refer to various text-related selectors such as <p> and <h1> and can be used locally, in external or internal style sheets, as well as for hyperlinks, classes and identifiers.The main text formatting properties are:
- font-family - sets one or more font names or font families
- font-style – specifies a font style, for example italic
- font-weight – sets font weight such as bold, normal, etc.
- font-size – sets the size (size) of the font in one of the measurement units, for example pt, px, in, cm or by a descriptive word like small, medium, large
- color – specifies a text color where the value is a color name or number
- background-color – specifies the background color of the text, its value can also be a color name or number
- letter-spacing - sets the spacing between characters in text, with the value determining whether letters should be closer or further apart than the normal spacing for the given font and size.
There are different recommendations for using CSS styles. For example, if the color property is set, the background-color should also be set with a good enough contrast for smooth reading.