W3C home > Mailing lists > Public > public-html@w3.org > September 2016

Re: About list inside a paragraph

From: James Cobban <webmaster@Jamescobban.net>
Date: Sun, 25 Sep 2016 18:03:19 -0400
To: public-html@w3.org
Message-ID: <4e512054-6520-8be9-2e25-031fae60dade@Jamescobban.net>
On 2016-09-25 09:25 AM, pierre lafitte wrote:
> Hi, as a web developer I’ve been writing html for years, and html is very good, except for one case which always makes me think that there is something missing: the list inside a paragraph.
>
> Imagine you want to say:
>
> I went shopping today, I bought 4 things:  item1, item2, item3, item4.
The tags in HTML do not specify the appearance of the text, only its 
meaning.  The <ul> and <ol> tags are peers of the <p> and cannot appear 
within a <p>. In HTML a <ul> or <ol> tag _terminates_ an unclosed <p> 
tag as if immediately preceded by a </p>.  XHTML is badly formed if the 
</p> is omitted.  Your "list" does not match the "meaning" of list as 
described by HTML which requires it to be a peer of paragraphs.

You should use a <span> tag with an appropriate style, for example <span 
class="list-item"> to contain each of the items.  This makes each item 
an HTML element that you can treat just like a <li>.  Contain the list 
items inside a <span class="ul-list">.

-- 

James Cobban webmaster@jamescobban.net 
<contactAuthor.php?subject=Email%20Message>
Web-site: www.jamescobban.net <http://www.jamescobban.net/>
34 Palomino Dr.
Kanata, ON, CANADA
K2M 1M1
+1-613-592-9438
Received on Sunday, 25 September 2016 22:03:48 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:46:19 UTC