What is the appropriate way to wrap subtitles?

I have a title and subtitles:

Programmer

Saving the world with bikeshevs and perl hacks.

What I imagine like this:

<h1>The Programmer</h1>
<p><strong>Saving the world with bikesheds and perl hacks.</strong></p>

However, perhaps this is more appropriate:

<h1>The Programmer</h1>
<p class="subtitle">Saving the world with bikesheds and perl hacks.</p>

But, since it seems appropriate to put the class subtitleon an element, this will not be better:

<h1>The Programmer</h1>
<h2>Saving the world with bikesheds and perl hacks.<h2>

What would be more appropriate?

+3
source share
4 answers

Well, I think that using the correct markup is more appropriate, if it is a heading (for example, the beginning of a chapter), you should definitely use it <h2>. If this is just a way to emphasize the content, I think it's best to use the CSS class for you to explain what it is.

html 5, <header > , :

<header>
    <h1>The most important heading on this page</h1>
    <p>With some supplementary information</p>
</header>

<article>
<header>
    <h1>Title of this article</h1>
    <p>By Richard Clark</p>
</header>
    <p>...Lorem Ipsum dolor set amet...</p>
</article>

html5.

" html5" ( , , !)

+3

HTML4 , , , tagline, :

<h1>The Programmer</h1>
<p class="tagline">Saving the world with bikesheds and perl hacks.</p>

HTML5 <section>, <header> <hgroup> <h1> <h2>, - :

<section>
    <header>
        <hgroup>
            <h1>The Programmer</h1>
            <h2>Saving the world with bikesheds and perl hacks.<h2>
        </hgroup>
    </header>
    ...
</section>

( <article> <section> - - , HTML5 ).

+5

"" ( ); , , <h1> . : , , .

, , , . , , .

0

. , css.

0

All Articles