12

I’ve noticed that some answers start with a a <h1>/<h2> not to structure the answer in different parts --there’s only one-- but to attract eyeballs.

I guess there can be legitimate uses; however in my experience these answers tend to attract my eyes a lot more than the checkmark of the accepted answer or the number of upvotes.

See for example this question. I came back on it through Google one year after I left an answer on it because I believed none of the existing ones were correct. I still believe this revision of an answer is wrong, but it has a <h2> at the beginning that immediately attracted my attention only because it’s some big bold text.

I don’t feel legitimate to edit the answer to remove the title text because I have an answer there and it could be seen as a conflict of interest, but I think it’s a bad thing for readers that a wrong answer can attract attention only because someone put some big bold text at the beginning.

Is this sentiment shared by others, and if so could/should Stack Overflow do something about it?

17
  • 5
    The answer clearly isn't using the heading properly. It's meta information that should be left out. It's not at all establishing a structure in the text.
    – VLAZ
    Commented Sep 28, 2022 at 10:56
  • 2
    "could/should StackOverflow do something about it?" unfortunately, I don't see what can be done. It's a piece of formatting. Whether it's used correctly or not isn't something that can be detected easily.
    – VLAZ
    Commented Sep 28, 2022 at 10:58
  • 6
    This is just a different misuse of markdown, like making everything emphasised or that product names are "code"; editing it out (especially when the text is also just noise) is the correct call here. Heading can be useful, but only when the text should and needs to be split into logical parts. having a heading at the top of an answer, when it's not put into parts, doesn't make sense.
    – Thom A
    Commented Sep 28, 2022 at 11:17
  • Perhaps make the title more specific (to include the essence of "attract eyeballs")? It currently reads as a question whose answers most likely would include concerns about accessibility (there is already at least one other meta post about that). Commented Sep 28, 2022 at 11:38
  • An accessibility one (but it is without answers. There must be other ones): Accessibility concerns about Stack Overflow. An older one on MSE (2013). A broader one (not about headlines specifically): Does Stack Overflow strive to meet accessibility standards? Commented Sep 28, 2022 at 11:58
  • 5
  • 1
    A reference for the action to the example question: Should "Edit:" in edits be discouraged? Commented Sep 28, 2022 at 12:16
  • I think questions about use of <h1> and <h2> should be focused on accessibility and screenreaders. The title of every question is by itself an <h1> so the logical sequence should be an <h2> or <h3> if you want to.
    – bad_coder
    Commented Sep 28, 2022 at 14:29
  • @TylerH it’s not a duplicate of that question because mine has nothing to do with accessibility. It is however a duplicate of the second question pointed out by Peter Mortensen above.
    – bfontaine
    Commented Sep 28, 2022 at 15:07
  • 1
    Regarding the latest buzzword "accessibility", we don't necessarily need to care about people viewing the site in a phone. That's a technical problem to solve for the phone, not for SO posters. Personally, I found out how to zoom in my phone web browser... it isn't hard at all.
    – Lundin
    Commented Sep 28, 2022 at 15:08
  • @bfontaine Actually accessibility is exactly what you're asking about. You may just not realize that your concern is part of accessibility concerns for web content.
    – TylerH
    Commented Sep 28, 2022 at 15:24
  • 1
    @Lundin who said anything about phones? Are you under the impression 'accessibility' has something to do with accessing websites on phones?
    – TylerH
    Commented Sep 28, 2022 at 15:26
  • It does. When we talk about "accessibility", we talk about "accessibility from all devices", including desktop or laptop computers, mobile phones, screen readers, etc.
    – bfontaine
    Commented Sep 28, 2022 at 15:38
  • @Lundin Latest buzzword? Java introduced an accessibility package in 1998. Maybe you just learned about it, but it’s been known to the world of software design for a long time.
    – VGR
    Commented Sep 28, 2022 at 16:54
  • I feel like it's worth (at least) mentioning that we only had three levels for the longest time, so if you wanted to use two levels, you had to use h2 and h3 at the minimum... if you wanted three, you had to use h1... Now I think we have at least five if not 6, so it's less necessary.
    – Catija
    Commented Sep 28, 2022 at 18:31

4 Answers 4

18

Use every element for its intended purpose

  • H1 should only be used for the question title. Accessibility guidelines say only one h1 should be used on every page.

  • H2 is the title of a individual answer. Only needed if the answer has a unique point that needs identification. This makes it easier to find the specific answer you are looking for without reading a wall of text. It can also serve as a TLDR to summarize the answer with the rest of the post giving more details.

  • H3 is a subsection of a answer, if needed.

  • Bold should be used for emphasis, never to create a header. Again, for the benefit of screen readers, and crawlers.

8
  • 1
    I've seen different accessibility guidelines give different advice regarding <h1> titles. Which accessibility guidelines are you referencing here? What difference does it actually make to users?
    – Flimm
    Commented Sep 28, 2022 at 14:42
  • 2
    @Flimm romeo.elsevier.com/accessibility_checklist
    – mousetail
    Commented Sep 28, 2022 at 14:46
  • 1
    I think the intended purpose of ## headlines was just that.. headlines. ## SCANDAL: HOMEWORK QUESTION POSTED ON SO. But we aren't trying to sell tabloid newspapers here... And either way "Updated answer that covers most cases" is not a meaningful title for an answer.
    – Lundin
    Commented Sep 28, 2022 at 14:56
  • 3
    Overall, layout guidelines/best practices of something like a scientific paper or general technical document are probably very different for guidelines how to write online documentation/manuals. It isn't obvious which category SO posts belong to, but as usual, applying common sense gets us very far.
    – Lundin
    Commented Sep 28, 2022 at 15:02
  • @Lundin Agreed that "Updated answer that covers most use cases" is a exceptionally useless title
    – mousetail
    Commented Sep 28, 2022 at 15:39
  • 4
    If you've never used a screen reader (SR) it may be hard to understand how headings work. In my (admittedly limited) experience, having headings for each answer can be great for SRs. It's like having bookmarks for every chapter in a book (or a ToC). Instead of having to skim each and every paragraph of each and every page to find what you want, you can just read the headings and get an idea if what you want may be in that section.
    – Laurel
    Commented Sep 28, 2022 at 15:53
  • 1
    @Laurel I don't doubt it, but the users of SO aren't here to design screen readers or web site layouts, but to post technical Q&A about programming.
    – Lundin
    Commented Sep 28, 2022 at 18:56
  • Aside: am I the only one who finds that h2 and h3 styling are much too similar with Stack Overflow's default CSS? Commented Sep 29, 2022 at 2:00
8

I think it should be corrected through editing, and shouldn't be treated as trivial. It breaks conventions that enable more accessibility for a more bespoke presentation.

I don't think software can dictate it, and this really seems like one of those cases where any great regex idea would very likely have unintended side effects that drive editors crazy, but one usually has some kind of preamble before the first heading if they're using it semantically .. so these could be scoped relatively easily if someone wanted to dig in.

3
  • 5
    "breaks conventions that enable more accessibility" What conventions? And why would you need a preamble to use a header semantically?
    – Laurel
    Commented Sep 28, 2022 at 12:52
  • 5
    On the contrary, having <h1> or <h2> in the beginning of an answer probably helps accessibility.
    – Flimm
    Commented Sep 28, 2022 at 14:25
  • 3
    For accessibility it's better to use <h2> but a title is defiantly helpful
    – mousetail
    Commented Sep 28, 2022 at 14:31
6

Huge titles are very distracting and should be edited.

Generally, it is fine to use titles for answers or sections of answers, in case they are really extensive. But that can also be achieved with bold formatting, which isn't nearly as distracting as the font size matches that of the text.

The general stance of the community is that things that distract rather than clarify the technical content of a post should be removed. This includes "fluff" such as the author rambling on about some story of their life, or drop long anecdotes that are only mildly related to the question, or post signatures.

But also unorthodox formatting such as weird emphasis of things that don't call for emphasis. Examples:

  • "I am programming this in Java". Edit to remove pointless emphasis.
  • "I like to add code formatting to random nouns that are not code or language keywords". Edit to remove code formatting.

In my opinion, the huge titles sort in the same category as "fluff" as well as weird formatting/emphasis. They should be changed to bold formatting or no formatting at all, whatever seems to fit the post.

I think the edits here were correct and appropriate, since they removed "fluff" but preserved the important parts of the answer. Notably the OP used to have bold formatting, but for some reason decided to go bigger still with edits, which was just distracting.

5
  • 4
    "Huge titles are very distracting". As you state, that's your opinion. I find a properly used heading very helpful to navigate whereas bold or an improperly used heading (e.g. starting the answer with a H3 or H4) to not be good at all for navigating. I can't visually scan for those.
    – Laurel
    Commented Sep 28, 2022 at 15:01
  • 3
    @Laurel Yes I am stating opinions in an answer to a question tagged discussion, what's your point? Do we really have to beat the dead horse about how meta works and serves to establish community consensus through voting again?
    – Lundin
    Commented Sep 28, 2022 at 15:04
  • 2
    If we both have different preferences, why should yours be the one that we go with? If someone doesn't like how monospace code looks, should we allow them to format code as plain text? (Of course not.) Your other examples are not about opinions: we don't format random words as code because it's incorrect HTML and causes problems for some screen readers. In fact, what I expressed as my opinion about headings is not just my opinion but also accessibility best practices.
    – Laurel
    Commented Sep 28, 2022 at 15:37
  • @Laurel If we both have different preferences, then why are you surprised that I argue in favour of mine? SO users should only have to care about the technical content of their posts, how to present that to readers with various needs, preferred viewing devices and no on is not a concern for users, but for the site designers and those who design the viewing devices. Otherwise we can as well start making similar strange arguments such as: "posts must be kept short, in order to minimize server use, in order to minimize power consumption, in order to stop global warming".
    – Lundin
    Commented Sep 28, 2022 at 18:53
  • First line of your post should be <h1>Huge titles are very distracting and should be edited.</h1> 😁 Commented Sep 28, 2022 at 21:17
-5

Titles for answers are great!

If you can summarise your answer with a beautiful title at the beginning of your answer, please do that.

Some questions attract many answers, and it is difficult to know at a glance what makes each answer unique. Having a title for an answer is very handy. Yes, they attract attention, but in a way that is beneficial to the readers, as it lets them decide quicker whether the answer is worth reading in its entirety or not.

2
  • 4
    Hmmm, +0.5 because having a bold statement at the start can sometimes be useful but also -0.5 because a sizeable portion of the time it's 100% noise. Commented Sep 28, 2022 at 14:37
  • 4
    Interesting that you used an <h2> rather than an <h1> here, so clearly some discretion is advised. Personally, <h3> seems about as big as an answer title needs to be, if that. Also, it'd be sort of weird to see a thread of 30-40 answers each with an <h1> or <h2> at the top dutifully announcing their value proposition to the world. Sometimes nuance is nice and not all internet content needs a TL;DR.
    – ggorlen
    Commented Sep 28, 2022 at 15:28

Not the answer you're looking for? Browse other questions tagged .