A few links about headings that I’ve had stored under my top hat.
“Page headings don’t belong in the header”
Martin Underhill:
I’ll start with where the
should be placed, and you’ll start to see why the isn’t the right location: it’s the header for the page, and the main page content should live within the element.
A classic conundrum! I’ve seen the main page heading (
) placed in all kinds of places, such as:
– The site (wrapping the site title)
– A nested in the content
– A dedicated outside the content
Aside from that first one — the site title serves a different purpose than the page title — Martin pokes at the other two structures, describing how the implicit semantics impact the usability of assistive tech, like screen readers. A is a wrapper for introductory content that may contain a heading element (in addition to other types of elements). Similarly, a heading might be considered part of the content rather than its own entity.
So:
Page heading
Page heading
A classic conundrum! I’ve seen the main page heading (
) placed in all kinds of places, such as:
– The site (wrapping the site title)
– A nested in the
– A dedicated outside the
Aside from that first one — the site title serves a different purpose than the page title — Martin pokes at the other two structures, describing how the implicit semantics impact the usability of assistive tech, like screen readers. A is a wrapper for introductory content that may contain a heading element (in addition to other types of elements). Similarly, a heading might be considered part of the
So:
Page heading
Page heading
Like many of the decisions we make in our work, there are implications:
– If the heading is in a that is outside of the
– If the heading is in a that is nested inside the
All of which leads to Martin to a third approach, where the heading should be directly in the
Page heading
This way:
– The landmark is preserved (as well as its role).
– The
is connected to the content.
– Navigating between the and is predictable and consistent. As Martin notes: “I’m really nit-picking here, but it’s important to think about things beyond the visually obvious.”
“Fluid Headings”
Donnie D’Amato:
There’s no shortage of posts that explain how to perform responsive typography. […] However, in those articles no one really mentions what qualities you are meant to look out for when figuring out the values. […] The recommendation there is to always include a non-viewport unit in the calculation with your viewport unit.
To recap, we’re talking about text that scales with the viewport size. That usually done with the clamp() function, which sets an “ideal” font size that’s locked between a minimum value and a maximum value it can’t exceed.
.article-heading {
font-size: clamp(, , );
}
As Donnie explains, it’s common to base the minimum and maximum values on actual font sizing:
.article-heading {
font-size: clamp(18px, , 36px);
}
…and the middle “ideal” value in viewport units for fluidity between the min and max values:
.article-heading {
font-size: clamp(18px, 4vw, 36px);
}
But the issue here, as explained by Maxwell Barvian on Smashing Magazine, is that this muffs up accessibility if the user applies zooming on the page. Maxwell’s idea is to use a non-viewport unit for the middle “ideal” value so that the font size scales to the user’s settings.
Donnie’s idea is to calculate the middle value as the difference between the min and max values and make it relative to the difference between the maximum number of characters per line (something between 40-80 characters) and the smallest viewport size you
– Navigating between the and
As Martin notes: “I’m really nit-picking here, but it’s important to think about things beyond the visually obvious.”
“Fluid Headings”
Donnie D’Amato:
There’s no shortage of posts that explain how to perform responsive typography. […] However, in those articles no one really mentions what qualities you are meant to look out for when figuring out the values. […] The recommendation there is to always include a non-viewport unit in the calculation with your viewport unit.
To recap, we’re talking about text that scales with the viewport size. That usually done with the clamp() function, which sets an “ideal” font size that’s locked between a minimum value and a maximum value it can’t exceed.
.article-heading {
font-size: clamp(
}
As Donnie explains, it’s common to base the minimum and maximum values on actual font sizing:
.article-heading {
font-size: clamp(18px,
}
…and the middle “ideal” value in viewport units for fluidity between the min and max values:
.article-heading {
font-size: clamp(18px, 4vw, 36px);
}
But the issue here, as explained by Maxwell Barvian on Smashing Magazine, is that this muffs up accessibility if the user applies zooming on the page. Maxwell’s idea is to use a non-viewport unit for the middle “ideal” value so that the font size scales to the user’s settings.
Donnie’s idea is to calculate the middle value as the difference between the min and max values and make it relative to the difference between the maximum number of characters per line (something between 40-80 characters) and the smallest viewport size you



