HTML Descendants and Content Model

Say we have this markup:

<ul>
    <li>
        <span></span>
    </li>
</ul>
  • Lee is a descendant and descendant of ul
  • Span is a child and descendant of li
  • Span is a descendant of ul

Reading the specifications for ul , we have:

Content Model :
 Zero or more li and script -supporting elements.

And the semantics section for the Content model says (emphasize mine):

Content Model
A normative description of what content should be included as
children and descendants of an element.

Of course, I think about it wrong, but I can not get them to calculate. Because span is not part of "Zero or more li elements" and is a descendant of ul.

: " , ". , .

, .


. . , , HTML .., :

  • li, - ,
  • li , .

" " .

+4
1

, 3.2.3 , . , 3.2.4 , : " , , : . HTML , , . - DOM, , ".

, , ( ) , . , , node (, , ).

, a ul li script . li , . ; <ul></ul> HTML5.

+3

Source: https://habr.com/ru/post/1528810/


All Articles