CSS properties: Text · Font · Background

Examples below show common properties you will use often. Each example is annotated by the class name used.

Text properties

color: Sets the text color. (class .txt-color)
This paragraph uses the color property to make text blue.
text-align: Align text horizontally. (class .txt-align-center)
This block is centered using text-align:center.
text-decoration: Underline, overline, strike-through or dotted/ wavy styles.
Here we used a dotted underline and changed its color/ thickness.
text-transform: change case. (class .txt-transform)
THIS TEXT IS UPPERCASE USING text-transform: uppercase.
line-height: The space between lines. (class .txt-lineheight)
This paragraph uses a larger line-height to improve readability for blocks of text.
letter-spacing: Space between letters. (class .txt-letter)
THIS TEXT HAS MORE GAP BETWEEN CHARACTERS.
word-spacing: Space between words. (class .txt-word)
Words are spaced further apart here.
text-shadow: Adds shadow to text for depth. (class .txt-shadow)
Subtle shadow improves contrast on pale backgrounds.

Font properties

font-family: Choose font stack. (class .font-family-slab)
This sample uses a serif stack (Georgia, Times).
monospace fonts: Useful for code and aligned text. (class .font-family-mono)
Monospace text keeps fixed character widths.
font-size: Control text size. (class .font-size-xxl)
Larger font for headings or important calls-to-action.
font-style & font-weight: Italic vs bold. (classes .font-style-italic, .font-weight-700)
Use font-style for emphasis and font-weight for visual weight.
font-variant: Small-caps (typographic effect). (class .font-variant-smallcaps)
Small-caps present a formal typographic style.

Background properties

background-color: Solid background. (class .bg-solid)
Use to create contrast behind text (accessibility tip: ensure sufficient contrast).
background (gradient): Smooth color transitions. (class .bg-gradient)
Great for soft visual accents.
background-image + repeat + position + size: Patterned backgrounds using SVG data-URL. (class .bg-pattern)
Data-URL avoids external images and is useful in single-file demos.
background-size: cover / background-attachment: fixed
Use cover to ensure large background covers container; fixed creates parallax-like effect.
Tip: combine these properties to craft readable, attractive UI — always check color contrast for accessibility.