
Text in CSS
Text in CSS — Styling Text Content
CSS provides many properties to control the appearance and layout of text on your web pages.
Common Text Properties
1. color
Sets the text color.
p { color: #333333;}
2. font-family
Specifies the font.
h1 { font-family: 'Arial', sans-serif;}
3. font-size
Sets the size of the text.
p { font-size: 16px;}
4. font-weight
Controls the thickness of the text (normal, bold, or numeric 100-900).
strong { font-weight: bold;}
5. font-style
Italicizes or normalizes text.
em { font-style: italic;}
6. text-align
Aligns text horizontally (left, right, center, justify).
h2 { text-align: center;}
7. text-decoration
Adds underline, overline, line-through, or none.
a { text-decoration: none;}
8. text-transform
Changes case: uppercase, lowercase, capitalize.
h3 { text-transform: uppercase;}
9. line-height
Controls space between lines.
p { line-height: 1.5;}
10. letter-spacing
Adjusts space between characters.
h1 { letter-spacing: 2px;}
11. word-spacing
Adjusts space between words.
p { word-spacing: 4px;}
12. white-space
Controls how whitespace inside text is handled (normal, nowrap, pre, pre-line, pre-wrap).
pre { white-space: pre;}
Example:
p { color: #444; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 16px; line-height: 1.6; text-align: justify; letter-spacing: 0.5px;}
If you want, I can show you examples of typography systems, web fonts integration, or how to create readable and accessible text styles!