16

When writing Markdown on Stack Overflow, you can create HTML section headings, also known as <h1> or <hx>, using '#' 1–6 times. This is very useful for questions and answers because you can create different visual heading levels that make it easier to read and understand a question or answer. However, creating headings that skip levels or unnecessarily reset the levels is an accessibility concern as per W3C's accessibility tutorial on headings.

I'm an h1

I'm an h3

I'm an h2

Alongside this, it would appear that there are no semantic elements being used for the individual questions and answers. One would expect an <article> element to be used for these and as such, they should be easily identifiable with a header. This would mean that requiring a top heading on new answers, much like the way that questions require titles, would be beneficial as well.

All in all, it looks like there are some accessibility improvements that could possibly be made within Stack Overflow.

13
  • 7
    As any contributor can create content I'm unsure who you expect to address these concerns / improvements? You'll never reach wcag compliance as long as you offer a textbox where people are free to type / structure however they see fit.
    – rene
    Feb 7, 2021 at 7:50
  • 7
    I don't need the "new contributor" tag to tell you're new. We can't get people to spell "I" correctly, or to post code as text instead of pictures of screens that have text on them. I seriously doubt we'd be able to get them to think about accessibility when posting about the latest typo they made while copying and pasting an answer. Sorry, just being realistic here. Feb 8, 2021 at 0:03
  • 1
    This is about accessibility, @cigien. The first part is about the impact of headings in the markdown. The second half is about the lack of landmark elements within StackOverflow's question page.
    – Andria
    Feb 8, 2021 at 23:16
  • @heretic-monkey I know that you can't control what people will type into a text-based input, however, it's not impossible to implement better control over HTML headings. In the current state of just being a textbox, yes it would prove hard which is why the solution would likely be more than a textbox. We already have on-screen buttons and keyboard shortcuts to create headings and do other formatting, all we have to do is take it one step further and prevent heading skipping and perhaps start at h2/3 and go down as that would be the most appropriate header levels for questions and answers
    – Andria
    Feb 8, 2021 at 23:24
  • 1
    Related (but not identical) MSE discussion, "Is using 'header' markdown okay in answers?" Oct 7, 2021 at 15:11
  • 6
    I don't think we should dismiss this by shrugging our shoulders and saying "it's user generated content; we are helpless". StackOverflow should set a high standard here. Software can do more without the need for moderators— it's not hard to tell when headings are out of order or alt text is missing. It's also something W3C is looking at. [ugh just noticed the date — sorry to revive this old thread]
    – Mark
    Mar 29, 2022 at 5:18
  • 1
    Related MSE post: Can we make Markdown headers semantically correct?
    – V2Blast
    May 31, 2022 at 17:10
  • 1
    @Makyen: A note for future readers – your comment is outdated. See this post for an example of all 6 levels of headings supported on Stack Exchange, plus bolded text and regular text for comparison. (I'm just using it as an example of how the header formatting is rendered; the text of the linked post itself is no longer accurate, as it was written years ago.)
    – V2Blast
    May 31, 2022 at 17:16
  • @V2Blast: It was written 1.3 years ago. May 31, 2022 at 17:27
  • @PeterMortensen: Whoops, got my phrasing confused there – I meant that the text of the post I linked is no longer accurate (not the text of the comment I was replying to).
    – V2Blast
    May 31, 2022 at 17:28
  • 1
    @V2Blast Yep, thanks for pointing out my outdated comment. I'm actually aware that SE enabled <h4> through <h6> headings sometime prior to 2021-07-11 (see my revision 13 here). I haven't gone back through looking for comments where I stated that h4 through h6 aren't possible. I appreciate you pointing out the erroneous comment.
    – Makyen Mod
    May 31, 2022 at 17:37
  • @Makyen: No worries, I figured you knew – I only wanted to point it out because someone else linked to that comment recently (not realizing that it was no longer accurate).
    – V2Blast
    May 31, 2022 at 17:43
  • What is your question?
    – TylerH
    Sep 28, 2022 at 14:31

0

You must log in to answer this question.

Browse other questions tagged .