FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Preserve whitespace while wrapping
Use CSS pre-wrap for multiline text that retains spaces.
CSS✓ Tested
Set readable line spacing
Use a unitless CSS line-height that scales with the font size.
CSS✓ Tested
Style list markers
Set marker color separately from list text using CSS ::marker.
CSS✓ Tested
Truncate a single line
Combine CSS overflow and ellipsis for a constrained single line.
CSS✓ Tested
Wrap long words
Allow long unbroken text to wrap within a CSS box.
CSS✓ Tested