|
Posted by Jonathan N. Little on September 10, 2007, 10:27 am
Please log in for more thread options
Jukka K. Korpela wrote:
> Scripsit David Trimboli:
>
>> What would be the best way to represent subtitles and bylines in HTML
>> 4.01?
>
> All ways are more or less debatable, but some of them make much more
> sense than others.
>
>> TITLE: Subtitles and Bylines in HTML
>> SUBTITLE: Being an Examination of Semantic Best Practices in the
>> Creation of Web Pages
>> BYLINE: by David Trimboli
>>
>> The title would most likely be an H1. What about the others? They're
>> not really paragraphs, are they?
>
> No, they are not paragraphs. You could make them <div> elements,
> probably with class attributes. You could make the byline an <address>
> element, especially if you add some contact info other than just the
> name, like e-mail address.
>
> Some people would make the subtitle an <h2> element, but I think it is
> more reasonable to treat it as part of <h1>:
>
> <h1>Subtitles and Bylines in HTML<br>
> <small>Being an Examination of Semantic Best Practices in the
> Creation of Web Pages</small></h1>
>
> Someone might argue that <small> is physical not logical markup, and in
> principle that's true. The alternative is to use <span>, which means
> nothing (i.e., is semantically empty) and does not affect rendering
> without CSS.
>
I would be more inclined to use SPAN, your could give the SPAN a class
like 'subtitle' but not needed you could just use the association that a
SPAN within the H1 is a sub-heading and uses modifying style. A little
cleaner on the markup.
h1 span {
display: block; margin: 0 .25em; font-size: .8em;
}
.byline {
padding-right: .5em; border-top: 1px solid #555; text-align: right;
}
<h1>
Subtitles and Bylines in HTML
<span>
Being an Examination of Semantic Best Practices in the Creation of
Web Pages
</span>
</h1>
<div class="byline">by David Trimboli</div>
<p>The article ...
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
|