FrancisLepage
|
Hello all!
I’m trying to figure out the right approach to structuring the heading of chapter with multiple lines of texts, followed by a subtitle.
For example, if I have something like;
<p style=”text-align: center;”>Chapter 1</p>
<p style=”text-align: center;”>Main Tile</p>
<p style=”text-align: center;”>A subtitle for this chapter</p>
What seems to be the right approach would be something like:
<section epub:type=”chapter” role=”doc-chapter” aria-labelledby=”ch”>
<hgroup>
<h1 id=”ch” title=”Chapter 1 – Main Title”><span class=”block”>Chapter 1 </span>Main Title</h1>
<p role=”doc-subtitle”>A subtitle for this chapter</p>
</hgroup>
Where block would be defined as:
span.block { display: block; }
Am I on the right track?
October 16, 2023 at 8:33 am
|
APLN Moderator
|
Hi Francis,
Thank you for this post!
You’re spot on about the multi-line headings—they shouldn’t be formatted using <br/> but instead using { display: block; } in the CSS as in your example.
And using role=”doc-subtitle” on a <p> tag is also correct because if this role is used on a heading element, it changes the element’s semantic meaning from a heading to a subtitle.
October 17, 2023 at 12:09 pm
|