HTML.it - Guida CSS di base - Selettore generale di fratelli

1. Titolo principale h1

1.1 Primo sottotitolo h2

...

1.2 Secondo sottotitolo h2

...

<div> 
  <h1>1. Titolo principale h1</h1>
  <h2>1.1 Primo sottotitolo h2</h2>
  <p>...</p>
  <h2>1.2 Secondo sottotitolo h2</h2>
  <p>...</p>
</div>
h1 ~ h2 {color: white;}
...

Sottotitolo h2

Sottotitolo h3

...

Sottotitolo h2

Sottotitolo h3

...

Sottotitolo h2

Sottotitolo h3

<div> 
  ...
  <h2>Sottotitolo h2</h2>
  <h3>Sottotitolo h3</h3>
  ...
  <h2>Sottotitolo h2</h2>
  <h3>Sottotitolo h3</h3>
  ...
  <h2>Sottotitolo h2</h2>
  <h3>Sottotitolo h3</h3>
</div>
h3 ~ h2 {color: white;}