Text, links, and list styling
W3C CSS Snapshot 2026
Extend font sizing and line height with alignment, line length, readable links, and list markers.
On this page
Set text alignment and spacing
text-align controls where inline content sits inside a block. start follows the writing direction. letter-spacing adjusts space between characters, and max-inline-size can keep a paragraph from getting too wide.
How to try it Save this example as a new .html file, then open it in your browser. After a change, save and reload.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Set text alignment and spacing</title>
<style>
h2 { text-align: center; letter-spacing: 0.04em; }
p { text-align: start; max-inline-size: 48ch; line-height: 1.6; }
</style>
</head>
<body>
<h2>Library Hours</h2>
<p>The study room opens at nine. Bring your library card if you plan to reserve a desk or borrow a book.</p>
</body>
</html>
What to expect The heading is centered. The paragraph keeps a shorter line on wide previews.
Make links and list markers easy to recognize
Keep a visible underline for links embedded in text. list-style-type changes the marker shape, and ::marker can style the marker separately from the list text.
How to try it Save this example as a new .html file, then open it in your browser. After a change, save and reload.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Make links and list markers easy to recognize</title>
<style>
a { text-decoration: underline; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 0.14em; }
ul { list-style-type: square; }
li::marker { color: #087f83; }
</style>
</head>
<body>
<p>See the <a href="#schedule">workshop schedule</a>.</p>
<ul id="schedule"><li>Introduction</li><li>Practice session</li></ul>
</body>
</html>
What to expect The link is underlined and each list item has a teal square marker.