This template demonstrates the most commonly used CSS text and font properties with examples. Each section covers a key property, its possible values, and a visual example.
font-familySpecifies the font for text, e.g., "Arial", sans-serif, "Times New Roman", serif.
font-sizeSets the size of the font, e.g., 16px, 1.2em, 2rem.
font-weightControls the thickness of the font, e.g., normal, bold, 700.
font-styleSets the style of the font, e.g., normal, italic.
fontShorthand for font-style, font-weight, font-size, line-height, font-family, e.g., italic bold 16px/1.5 Arial.
colorSets the text color, e.g., #ff0000, red, rgb(0, 255, 0).
text-alignAligns text horizontally, e.g., left, right, center, justify.
text-decorationSets text decoration, e.g., none, underline, line-through.
text-transformTransforms text case, e.g., none, uppercase, lowercase, capitalize.
line-heightSets the height of a line box, e.g., normal, 1.5, 20px.
letter-spacingSets spacing between characters, e.g., normal, 2px, -1px.
word-spacingSets spacing between words, e.g., normal, 5px, -2px.
text-shadowAdds shadow to text, e.g., 2px 2px 4px rgba(0,0,0,0.5).
white-spaceControls white-space handling, e.g., normal, nowrap, pre.
text-overflowHandles overflowed text, e.g., clip, ellipsis.