talena6
talena6

Reputation: 317

Is it semantically acceptable to have H2 be a larger font size than H1?

My page title is at the top of the page and stands out with a background color, but is a smaller font size than my H2. Is this semantically "allowed"? Or is it better to set my page title to H2?

Upvotes: 1

Views: 346

Answers (1)

BoltClock
BoltClock

Reputation: 723518

There is nothing wrong with having an H1 be a smaller font size than an H2 if that is what your design calls for.

As far as HTML is concerned, an H1 is by definition higher-ranking than an H2. No amount of styling will change the semantics of an HTML document; the semantics are pre-baked into the markup language. In particular, the various heading elements have significant effects on how a document is outlined.

Upvotes: 1

Related Questions