Reputation: 31252
I get the following validation error when I tested my HTML.
Please look at the attached image for the HTML code.
"Element
ul
not allowed as child of element ol
in this context."
Upvotes: 0
Views: 14213
Reputation: 191749
This is because the content model for <ol>
(and <ul>
actually) is zero or more li
elements
These two tags actually can't contain anything other than <li>
tags or nothing at all. If you have <ol><ul>
browsers will automatically close the <ol>
tag before beginning the <ul>
(well, the good ones).
I think your intent is to have:
<ol>
<li>
<ul>
The <ul>
can be contained inside of an <li>
that is a child of the <ol>
.
Upvotes: 9
Reputation: 31
You should do these
<ol>
...
<li>title</li>
<li><!-- add this -->
<ul><!-- your ul put here -->
...
</ul>
</li><!-- add this -->
...
</ol>
PS. In some case use original code better than image.
Upvotes: 1
Reputation: 6075
This is because you should wrap the internal <ul> in a list <li> item:
<ul><li>text</li>....</ul>
becomes:
<li><ul><li>text</li>....</ul></li>
Upvotes: 4