2
\$\begingroup\$

This question already has an answer here:

I've seen people use # (h1) and ## (h2) on the language name and program size in their answers, but is one of them considered better?

\$\endgroup\$

marked as duplicate by James Holderness, Sriotchilism O'Zaic, 12Me21, Community Feb 22 '17 at 3:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

9
\$\begingroup\$

Back in the day, HTML style guides told you to use only one <h1> in a page. Given the semantics of a StackExchange page, that should be the question title. Therefore we old fogies consider ## better.

Nowadays some people consider that advice antiquated. I leave it to them to say whether they consider # and ## equally good or whether they have arguments either way.

\$\endgroup\$
8
\$\begingroup\$

As one of the users of #, here's my rationale.

  1. Markdown gives you a handy way of grouping your post into (sub)sections using #, ##, and ###. If you use # for the header, you still get sections and subsections. If you use ##, you only get sections.

  2. When writing Markdown, I don't really consider the HTML is generates. If <h1> is not meant to be used in answers, # should generate <h2> elements. I can't do anything about this.

  3. Having multiple <h1> elements in one page is valid HTML. It used to be a bad idea, but that's no longer true for HTML5.

\$\endgroup\$
  • \$\begingroup\$ Agreed. Some people write <h1> in their answers, but I use #, which isn't HTML, it's markdown. \$\endgroup\$ – mbomb007 Feb 20 '17 at 19:57
  • \$\begingroup\$ Regarding point 3, that article is wrong about the use of H1 in HTML5. There was a time when the draft spec allowed multiple H1s, but they eventually scrapped that idea. The current recommendation is you "should use headings of the appropriate rank for the section's nesting level." I agree with your other points though. \$\endgroup\$ – James Holderness Feb 21 '17 at 0:06

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