Cascading Style Sheets (CSS) describe how HTML displays elements on the screen.
CSS can control the layout of multiple web pages with a few lines of code.
CSS has formatting properties that affect the spacing, appearance, and alignment of text.
Text Color
Thecolorproperty specifies the main foreground color of your text.
you might use a predefined color name likered,white, orgreen.
you might also use a hex value or other units like RGB, HSL, and RGBA.
CSS frameworks likeTailwind CSShave a built-in color feature that displays a variety of shades.
This makes it easier for you to select a shade you prefer.
Background Color
you might use thebackground-colorproperty to createappealing backgrounds.
Text Alignment
Thetext-alignproperty sets the horizontal alignment of text.
This value can beleft,right,center, orjustify.
Text Direction
Thetext-directionproperty defines the direction of text.
Define the direction using propertiesrtl(right to left) orltr(left to right).
These two specify which direction you want the text to flow.
For example, usertlwhen working with languages written from right to left like Hebrew or Arabic.
You useltrfor languages written from left to right like English.
Text Decoration
Thetext-decorationproperty sets the appearance of decorative lines on text.
It’s shorthand fortext-decoration-line,text-decoration-color,text-decoration-style, andtext-decoration-thicknessproperty.
Text Transform
Thetext-transformproperty specifies the jot down of case the letters appear.
This can be in uppercase or lowercase letters.
Letter Spacing
Theletter-spacingproperty specifies the space between the letters in text.
The following example illustrates how to specify different spacing styles.
Word Spacing
Theword-spacingproperty specifies the space between the words in a text.
Browsers have a standard length for space between words, but you’re able to set your own.
Line Height
Theline-heightproperty specifies the spacing between lines in a paragraph.
The standard and default line height in most browsers is about 110% to 120%.
Text Shadow
Thetext-shadowproperty applies shadows to text.
You have to specify the horizontal shadow and the vertical shadow.Text-shadowcan include color and blur radius.
CSS is the backbone of modern web design.
Whether in its vanilla form or in frameworks, the basic function of CSS properties is the same.
Mastering text formatting properties allow you to create attractive and readable user interfaces.
The latest version of CSS, CSS3, introduces new concepts from animations to multiple-column layouts.
These concepts make it easier to create professional applications and documents.