[whatwg] Lists, <ins>/<del>, and <a>

Michel Fortin michel.fortin at michelf.com
Tue Aug 29 20:51:39 PDT 2006


Le 29 août 2006 à 23:00, Lachlan Hunt a écrit :

> Michel Fortin wrote:
>> How can we markup removed or inserted list items? Here's a general  
>> idea:
>>     <ul>
>>     <ins><li>Some list item</li></ins>
>>     <del><li>Another list item</li></del>
>>     </ul>
>
> This can be solved by putting the ins and del elements as the only  
> child nodes of the li elements instead.
>
> <ul>
>   <li><ins>Some list item</ins></li>
>   <li><del>Another list item</del></li>
> </ul>

The meaning of your markup is that you inserted and deleted some text  
within each list item, not that you added or deleted a list item like  
in mine. Semantically there is a difference, subtle maybe but still  
there.

Also, while your markup gives the same visual rendering while using  
the default browser stylesheet (which underlines <ins> and  
overstrikes <del>), the result will be completely different if you  
want to hide the inserted or deleted parts. Using this CSS rule:

     del { display: none }

you'll see a one-item list for my markup, while for your markup  
you'll see a second, empty list item.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/





More information about the whatwg mailing list