Assume we have an example HTML or XML document structured like this:
<body>
<section>
<h1>This should be numbered 1</h1>
<section>
<h1>This should be numbered 1.1</h1>
<p>blah</p>
</section>
<section>
<h1>This should be numbered 1.2</h1>
<p>blah</p>
</section>
</section>
<section>
<h1>This should be numbered 2</h1>
<section>
<h1>This should be numbered 2.1</h1>
<p>blah</p>
</section>
</section>
</body>
This specific layout is just for demonstration purposes, as the number of child-sections within a section can vary, and sections can be nested to any extent.
The question at hand is whether it's possible to utilize CSS (counters and generated content) to automatically generate the desired section number before each section title.
Previous examples mainly showcase this functionality with nested lists using 'counter-reset' on OL and 'counter-increment' on LI tags. However, in this case, it's essential for the 'section' element to both reset for its child-sections and increment relative to its parent section. Combining these behaviors under one element name seems to pose challenges.