-1

illustrating the problem

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/

Community
  • 1
  • 1
katerlouis
  • 536
  • 6
  • 16

3 Answers3

0

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, and h6 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:

nav h1{
    font-size:18px;
}

main h1{
    font-size:32px;
    color:black;
}

main h2,
main h1 + p{
    font-size:24px;
    color:grey;
}

I have two h1 of different sizes. You could argue that the main h1 should actually be an h2. But I like h1 because the nav and the main are really separate areas of content.

I also have an h2 and a p that end up the same size. You could argue that p should just be an h2. But I like to use h2 when it's introducing something by itself, rather than having it always stuck to an h1, 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):

  • I would assume there are several "Seit über 35 Jahren" pages. So even though the font is small, it should be an h1: it's introducing content across multiple pages.
  • "Naturstein - Leidenscha" introduces the content on this page specifically, so should be an h2.
  • "Das Unternehmen" seems to introduce one particular section on this page, so should be an 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.

RobertAKARobin
  • 3,933
  • 3
  • 24
  • 46
  • 1) "Forget how it looks when writing HTML" – tha'ts what I did. In this design the big headline simply is the most significant; that's why I made it an h1. – katerlouis Oct 17 '16 at 06:31
  • 2) Crazy. I used headlines in the kinda the opposite way. I thought google "needs" to know what is going on ON THIS PAGE and therefore looks at the h1. Your explanation makes much sense to me, now. But.. still.. how do I know that my assumption about how google finds out about the headline describing THIS PAGE is right and yours not? I'd like to know .. :( – katerlouis Oct 17 '16 at 06:33
  • 3) If I change the h-tags to your way the orange page works great for my SEO-lady. But then the first page ("Kontakt") would be left with no h1 at all, which will piss her off again. Also I read that google really wants an h1. What would you do here? – katerlouis Oct 17 '16 at 06:38
  • 4) I just checked again. – It's a coincidence that "Seit über 35 Jahren" [= "since 1970"] (my h3) is twice on that page. It's not a category or something describing multiple pages. How does your logic apply now? Still h2 for the big one, because it only describes content on this particular page? Then again, no h1 at all?! – katerlouis Oct 17 '16 at 06:42
  • In my opinion, `h1` isn't really for the most *significant* content; it's for the "highest" content -- it introduces everything else on the page. But people would probably argue both ways. The way I think of it is, "When people see this on Google, should the name of my site be the big blue text, or the name of the article?" – RobertAKARobin Oct 17 '16 at 14:25
  • 3) Move everything up a level? Make your `h2` into `h1`, and so on. – RobertAKARobin Oct 17 '16 at 14:25
  • Honestly, I would just go with whatever your boss likes. Thinking the SEO way is probably the most "correct" way to think about `h` tags since it forces you to think about their hierarchy in terms of importance/introduction. She's the one who pays your bills anyway. :) At the end of the day, if you ask 10 different designers you'll probably get 10 different opinions on this, so just pick something and be consistent. – RobertAKARobin Oct 17 '16 at 14:27
  • I'm confused... which headline do you guys now say google picks? h1? – katerlouis Oct 18 '16 at 08:38
0

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:

<div class="col-6 section-intro-content">
  <h4 class="section-sub-heading border-blue">
    Advertise
  </h4>
  <h2>
    Advertise with Google.
  </h2>
</div>

If you're unsure, ask the SEO person for a best practice in his/her opinion.

Fabian Schultz
  • 18,138
  • 5
  • 49
  • 56
  • My research tells that of all propsed solutions the worst one is not to have any h-tags at all. So using spans doesn't seem like an option. Did you get the code-example from the posted google page itself? I can't find it there. – katerlouis Oct 17 '16 at 06:26
  • Yes, it's from that link. That's what I was saying, using headings is crucial, but you might be able to use a span tag for that single one where the SEO person is complaining. – Fabian Schultz Oct 17 '16 at 06:30
  • Ah okay, you looked at the source code and assume that google would do their own SEO right? ;) – – katerlouis Oct 17 '16 at 06:39
  • Well, at least sign off on it. – Fabian Schultz Oct 17 '16 at 06:40
-1

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:

1. Document
  1.1 Navigation
2. "Seit über 35 Jahren"
3. "Naturstein – unsere Leidenschaft."
  3.1 "Das Unternehmen"
  3.2 "So arbeiten wir"
  3.3 "Referenzen"
  3.4 "Weitere Objekte"

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.:

<header>
  <p>Seit über 35 Jahren</p>
  <h1>Naturstein – unsere Leidenschaft.</h1>
</header>

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):

1. "Natursteinwerk Villmar"
  1.1 Navigation
  1.2 "Das Unternehmen"
  1.3 "So arbeiten wir"
  1.4 "Referenzen"
  1.5 "Weitere Objekte"

(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 a p.)

If not using a document heading:

1. Document
  1.1 Navigation
2. "Natursteinwerk Villmar"
  2.1 "Das Unternehmen"
  2.2 "So arbeiten wir"
  2.3 "Referenzen"
  2.4 "Weitere Objekte"

If you know which outline you want to have, choosing which heading elements (h1-h6) to use is easy: the first level gets h1, the second level gets h2, … -- headings represent rank, not importance.

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360