Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Subheadings/subtitles

Don’t use a heading element for subheadings/subtitles (details details).

So instead of

<header>
 <h1>Title</h1>
 <h2>Subhead</h2>
</header>

better use

<header>
 <h1>Title</h1>
 <p>Subhead</p>
</header>

header in article

Should I have a <header> inside each article?

It makes sense to use a header if you have more than just a heading element (h1-h6), e.g., something like a subheading (like in the example above) or other metadata.

It’s allowed to use header also if you only have a single heading, but it doesn’t really add anything in that case, semantically speaking.

div vs. section/article

Is there a difference between using div instead of sections or articles?

Yes, div is meaningless, while section and article are sectioning content elements (i.e., they create sections).

A section becomes part of the document outline, and sets the scope for header/footer (and in case of article, also for address).

Whenever you would use a heading element (h1-h6), you have an implict section anyway. It’s encouraged to make the sections explicit by adding a section element (or, where it applies, the more specific article, nav, or aside).

Subheadings/subtitles

Don’t use a heading element for subheadings/subtitles (details).

So instead of

<header>
 <h1>Title</h1>
 <h2>Subhead</h2>
</header>

better use

<header>
 <h1>Title</h1>
 <p>Subhead</p>
</header>

header in article

Should I have a <header> inside each article?

It makes sense to use a header if you have more than just a heading element (h1-h6), e.g., something like a subheading (like in the example above) or other metadata.

It’s allowed to use header also if you only have a single heading, but it doesn’t really add anything in that case, semantically speaking.

div vs. section/article

Is there a difference between using div instead of sections or articles?

Yes, div is meaningless, while section and article are sectioning content elements (i.e., they create sections).

A section becomes part of the document outline, and sets the scope for header/footer (and in case of article, also for address).

Whenever you would use a heading element (h1-h6), you have an implict section anyway. It’s encouraged to make the sections explicit by adding a section element (or, where it applies, the more specific article, nav, or aside).

Subheadings/subtitles

Don’t use a heading element for subheadings/subtitles (details).

So instead of

<header>
 <h1>Title</h1>
 <h2>Subhead</h2>
</header>

better use

<header>
 <h1>Title</h1>
 <p>Subhead</p>
</header>

header in article

Should I have a <header> inside each article?

It makes sense to use a header if you have more than just a heading element (h1-h6), e.g., something like a subheading (like in the example above) or other metadata.

It’s allowed to use header also if you only have a single heading, but it doesn’t really add anything in that case, semantically speaking.

div vs. section/article

Is there a difference between using div instead of sections or articles?

Yes, div is meaningless, while section and article are sectioning content elements (i.e., they create sections).

A section becomes part of the document outline, and sets the scope for header/footer (and in case of article, also for address).

Whenever you would use a heading element (h1-h6), you have an implict section anyway. It’s encouraged to make the sections explicit by adding a section element (or, where it applies, the more specific article, nav, or aside).

Source Link
unor
  • 2.7k
  • 15
  • 24

Subheadings/subtitles

Don’t use a heading element for subheadings/subtitles (details).

So instead of

<header>
 <h1>Title</h1>
 <h2>Subhead</h2>
</header>

better use

<header>
 <h1>Title</h1>
 <p>Subhead</p>
</header>

header in article

Should I have a <header> inside each article?

It makes sense to use a header if you have more than just a heading element (h1-h6), e.g., something like a subheading (like in the example above) or other metadata.

It’s allowed to use header also if you only have a single heading, but it doesn’t really add anything in that case, semantically speaking.

div vs. section/article

Is there a difference between using div instead of sections or articles?

Yes, div is meaningless, while section and article are sectioning content elements (i.e., they create sections).

A section becomes part of the document outline, and sets the scope for header/footer (and in case of article, also for address).

Whenever you would use a heading element (h1-h6), you have an implict section anyway. It’s encouraged to make the sections explicit by adding a section element (or, where it applies, the more specific article, nav, or aside).

lang-html

AltStyle によって変換されたページ (->オリジナル) /