CSS Tutorial · Chapter 5 of 7
CSS Typography
Control fonts and text readability.
font-family, font-size, font-weight, and line-height shape readable text.
Keep body text comfortable to read on laptop screens.
Typography sample
Try it Yourself »
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS Tutorial</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section class="card">
<h1>CoderKiosk CSS Lab</h1>
<p class="muted">Style this page using CSS.</p>
<button class="primary">Start Lesson</button>
</section>
</body>
</html>
style.css
body {
font-family: Georgia, serif;
font-size: 18px;
line-height: 1.6;
padding: 32px;
background: #fff7ed;
}
h1 {
font-family: Arial, sans-serif;
font-size: 2rem;
font-weight: 700;
}
.muted {
color: #9a3412;
}
Classroom Tips
- Use larger headings than body text.
- line-height around 1.5 helps paragraphs.