These 2 images illustrate my markup + the visual weight that clearly emphasizes the most important headline of the page. Sometimes the big headline has a little pre-headline
.. or.. subheadline
above it?
That’s the design; my job is bringing that to life in a web browser.
The site is live. Now comes the SEO guy, slaps my face and says:
You use h3, then h1, then h3 again. That’s just not right and that’ll
lower our Google rank.
(I highly question that and my feeling kinda was confirmed reading this stack-fred: Do HTML header tags need to go in order)
But let’s just assume she is totally right on that for a sec.
How would you solve this in markup and css?
What I did in orange in the second picture… it just feels wrong…
You can visit the website here:
www.natursteinwerk-villmar.de/
3
Answers
I think this is a great illustration of the difference between semantics and style. Basically: it’s too easy to get attached to the idea that
h1
should be big,h2
should be smaller, andh6
should be smallest.Any of these tags can have any font size you want. The difference between them is in the purpose of the content they’re introducing.
When designing a blog-ish webpage, I might do something like this:
I have two
h1
of different sizes. You could argue that themain h1
should actually be anh2
. But I likeh1
because thenav
and themain
are really separate areas of content.I also have an
h2
and ap
that end up the same size. You could argue thatp
should just be anh2
. But I like to useh2
when it’s introducing something by itself, rather than having it always stuck to anh1
, which feels like wasting HTML tags.At the end of the day, I’d say just try really hard to completely forget about how things are going to look when you write your HTML.
When I taught web design an exercise I really enjoyed was giving my students a “reset” stylesheet that removed all default browser styles, and asking them to design and write a webpage using only HTML and no CSS. It forced them to really consider what their HTML tags mean without getting hung up on things like, “Oh, if something’s going to be bold it has to be in a
strong
tag.”Thinking that way is really, really hard, but makes for intuitive design and intuitive code.
To your case specifically (keeping in mind that I don’t speak German):
h1
: it’s introducing content across multiple pages.h2
.h3
. I would expect there to be other sections on this page introduced the same way.Plus, having
.weight3
and.weight2
and stuff gets all crazy. How are you supposed to remember what the difference is between them? That’s the reason we don’t use the<big>
or<center>
tags anymore — saying a piece of text is “big” or “center” doesn’t give you any clue about what that text does.The orange solution you’ve noted is definitely worse from a SEO standpoint. Setting a single
h1
on the actual main headline is important. If the SEO person insists, it might be best to use something like<span class="h3">Seit...</span>
instead of using a heading tag for that at all.Google itself is also ignoring the order of headings, for example here:
If you’re unsure, ask the SEO person for a best practice in his/her opinion.
Let’s consider what is useful for your visitors (especially those that rely on the headings/outline, e.g., screen reader users), and forget about “SEO rules”.
Whether you want to follow HTML5’s outline algorithm (see tools), or if you just rely on the heading elements (without taking sectioning content element into account), it makes sense to think of it like a ToC.
Your homepage has this outline currently:
Is this helpful? I’d say the “Seit über 35 Jahren” section shouldn’t be there. If a user navigates to this heading, there is nothing there — no content, no sub-headings. It should be part of the content; it should not be a heading. Adding it to the following heading might be possible, but it seems to be more appropriate to make it a subtitle/tagline, e.g.:
That said, is “Naturstein – unsere Leidenschaft.” really a useful heading? It seems to be a slogan, or an introduction, but wouldn’t it be more useful to have the actual name (“Natursteinwerk Villmar”) as heading? If I’d mark up this site, I’d go for one of these outlines for the homepage:
If using the site name (which could also be the logo with
alt
) as document heading (for every page; see also):(Where the last four sections could be part of the
main
element. The visual design could stay the same, so “Naturstein – unsere Leidenschaft.” could still be in that big font size; the only difference being that it’s now ap
.)If not using a document heading:
If you know which outline you want to have, choosing which heading elements (
h1
–h6
) to use is easy: the first level getsh1
, the second level getsh2
, … — headings represent rank, not importance.