How to correctly format a chapter heading with multiple lines & a subtitle

  • This topic has 1 reply, 2 voices, and was last updated 1 month, 2 weeks ago by APLN Moderator.
Viewing 2 posts - 1 through 2 (of 2 total)
How to correctly format a chapter heading with multiple lines & a subtitle thread
Author Posts
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?

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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Want to join the discussion?

a wooden table with a white keyboard on top, and a persons hand writing on a piece of paper

View our current resources