Re: Using <p> elements purely as containers of phrasing elements? Semantic or not?

Ian, HTML 5.1 defines a paragraph [1] as:

A paragraph is typically a run of phrasing
content<http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#phrasing-content>that
forms a block of text with one or more sentences that discuss a
> particular topic, as in typography, but can also be used for more general
> thematic grouping. For instance, an address is also a paragraph, as is a
> part of a form, a byline, or a stanza in a poem.
>

A paragraph is represented by the <p> element. The important part of this
that applies to your question is that it can be used for general thematic
grouping, such as for related pairs of elements or footer information.

Jukka K. Korpela <jukka.k.korpela@kolumbus.fi> wrote:

No, and there is very little semantics in HTML in general. The word
> "semantic" as usually used as a buzzword really refers to structure, not
> semantics (meaning).
>

HTML does not merely exist as a set of containers that can be used for
style and structure.

Tim Berners-Lee wrote [2]:

HTML documents are SGML documents with generic semantics that are
> appropriate for representing information from a wide range of domains. HTML
> markup can represent hypertext news, mail, documentation, and hypermedia;
> menus of options; database query results; simple structured documents with
> in-lined graphics; and hypertext views of existing bodies of information.
>

The way we mark up a document gives it *additional* meaning, not just
structure.  It tells us what kind of information we are looking at, and how
to consume it.  This is one of the reasons why it is important to choose
the proper markup for a given piece of information.

Jukka K. Korpela <jukka.k.korpela@kolumbus.fi> wrote:

On the practical side, <ul> is good for a bulleted list, <ol> is good for a
> numbered list, and if you don’t want either of them, use some other markup.
> It does not matter much which, as long as each item is marked up as an
> element and there is a container for the items as a set. Then you can style
> it as desired.
>

It *does* matter which list structure we use to organize information.
Lists are used to organize related information.  Ordered lists are good for
serial information (do I add the eggs to the cake before I bake it, or
after?).  They are numbered as a matter of default presentation, but this
can be changed; the important part is that they are marked as having a
significant order.  Unordered lists are good for parallel information
(press the following three keys at the same time: ctrl, alt, delete).  We
just need to remember which three keys we need to press; we don't need to
go through the additional trouble of remembering the order.

The example markup in question [3] is as follows:

  <p><a href="about.html">About</a> -
     <a href="policy.html">Privacy Policy</a> -
     <a href="contact.html">Contact Us</a></p>

It is debatable whether this is related information (company information)
or unrelated information (company history, current policies, contact
information).  A list *could* be used here, but it doesn't necessarily add
any semantics to the content.  Instead, a paragraph element is used to
group themed information (common footer information).

--Xaxio

References:
[1] http://www.w3.org/html/wg/drafts/html/master/dom.html#paragraph
[2] http://tools.ietf.org/html/rfc1866
[3]
http://www.w3.org/html/wg/drafts/html/master/sections.html#the-nav-element

Received on Monday, 6 May 2013 18:48:12 UTC