CSS Text Properties
CSS Text Properties
✨ Text Properties
css
p {
color: blue;
}
css
h1 {
text-align: center;
}
css
a {
text-decoration: underline;
}
css
p {
text-transform: uppercase;
}
css
h2 {
letter-spacing: 2px;
}
css
p {
word-spacing: 5px;
}
css
p {
line-height: 1.5;
css
p {
text-indent: 50px;
}
css
h1 {
text-shadow: 2px 2px 5px gray;
}
🖍️ Font Properties
These properties define the style and appearance of the font used in text.
font-family: Specifies the font of the text. It's good practice to list multiple fonts as
fallbacks.
css
p {
font-family: "Arial", sans-serif;
}
css
h1 {
font-size: 24px;
}
css
p {
font-style: italic;
}
css
h2 {
font-weight: bold;
}
css
p {
font-variant: small-caps;
}
font: A shorthand property to set all the above font properties in one declaration.
css
p {
font: italic small-caps bold 16px/1.5 "Arial", sans-serif;
}