CSS EXAMPLE · WORKING REFERENCE

Typography Styling

Font size, weight, line-height aur readable text width se content style karo.

Working code

<article class="article">
  <h2>Learn CSS</h2>
  <p>Good typography makes long-form content easier to read.</p>
</article>

<style>
.article {
  max-width: 60ch;
  font-family: Arial, sans-serif;
}

.article h2 {
  font-size: 2rem;
  line-height: 1.2;
}

.article p {
  font-size: 1rem;
  line-height: 1.7;
  color: #4b5d73;
}
</style>
Run Code ▶

Preview

Learn CSS

Good typography makes long-form content easier to read.

How it works

font-size text scale aur line-height lines ke beech vertical spacing control karta hai.

max-width: 60ch line length ko readable range me limit karne ka simple pattern hai.

Try Yourself

<article class="article">
  <h2>Learn CSS</h2>
  <p>Good typography makes long-form content easier to read.</p>
</article>

<style>
.article {
  max-width: 55ch;
  font-family: Georgia, serif;
}

.article h2 {
  font-size: 2.4rem;
  line-height: 1.15;
}

.article p {
  font-size: 1.1rem;
  line-height: 1.8;
}
</style>

Learn this concept

Read related CSS Tutorial →