Nested Lists - li is a child of ul!
Keep in mind that the only allowed child of a ul
element
is an li
element. So in a nested list, the nested ul
needs to contained within the li
:
Correct | Incorrect ul must be within li |
---|---|
|
|
Sometimes this is confusing, since in the "HTML" form of HTML5, the end tags are options for li
, so while it may appear that you can have a ul
as a child of ul
, you really can't -- there's an implied end-tag there.
Correct HTML serialization | Correct XML serialization |
---|---|
|
|