Re: About list inside a paragraph

On 2016-09-25 06:18 PM, Patrick H. Lauke wrote:
> On 25/09/2016 23:03, James Cobban wrote:
>
>> 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>.
>
> Except that lacks any semantic "listiness", as that's not a list 
> anymore then, just a series of semantically neutral spans...
>
> P

The semantics of lists in HTML includes that lists are paragraphs. 
Changing that would break _all existing web-sites_ that use <ul> or 
<ol>, so it ain't gonna happen.  However using span tags with class 
names, or id values, that imply "listiness" means that "list-item" spans 
can be, for example, selected by JQuery.  The web developer can apply 
whatever behavior or appearance that is required to these "list-items".  
Semantics are ultimately a result of how objects behave, appear to the 
viewer, and are viewed by the developer, not a consequence of exactly 
which tag name is used.

If it is absolutely essential that the specific tags <ul>, <ol>, and 
<li> be used, which has not been justified, then the presentation can be 
changed by using a style of display: inline.  <ul style="display: 
inline"> still starts a new paragraph from the point of the browser, 
since the preceding <p> is terminated, but using display: inline causes 
the output of the list to be displayed after the last character of the 
preceding paragraph instead of at the left margin of the container.  You 
will have to override a bunch of other style fields to get the list to 
align with the text of the paragraph. This is not necessary when using 
<span> because <span> inherits style from the <p> it is contained in.  
Forcing the HTML tags to behave in a way that is inconsistent with the 
semantics defined by the standard is only going to cause the developer 
grief.

-- 

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 Monday, 26 September 2016 02:11:02 UTC