Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heading elements are for structure, not subtitles #38

Open
oliverjam opened this issue Oct 22, 2021 · 0 comments
Open

Heading elements are for structure, not subtitles #38

oliverjam opened this issue Oct 22, 2021 · 0 comments

Comments

@oliverjam
Copy link

oliverjam commented Oct 22, 2021

const html = /* html */ `<h2 class='signup'> please upload an image that represents you </h2>
<h3> <em> please </em> do not upload a photo of yourself to the internet, that is an extremely irresponsible thing to do! </h3>

Heading elements like h3 are there to create a page structure. If you imagine deleting everything but the headings you should be left with a table of contents that represents each section of the page. This means you should only use a new lower heading level when you're creating a sub-section within the current one.

You also should never skip heading levels—it doesn't make sense structurally to have an h1 followed by an h3; there must be an h2 in between (if you want the text to be smaller use CSS).

In this case (and a couple of others) you're using heading elements more like subtitles. Since this is just supplementary text (and not actually labelling a new section) it's ok to use a regular text element (like a <p>).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant