This could be a web component, or a simple include. The problem is, by using
<h2>, we've assumed the 'parent' heading is an
<h1>. If this snippet is moved elsewhere in the DOM, this assumption may break the heading outline.
What if, instead, we could write:
<h> element is contextual to its parent
<section>. Now this snippet can be moved around without breaking things - the heading always represents a subsection within its parent.
The structure of a document should be marked up in a nested manner, and this is mostly how HTML works: You put an
... read the whole story at jakearchibald.com.
<ol> within an
<li> to express a list within a list. Sections & headings should work the same.