Jurek Werter
Jurek Werter

Reputation: 11

document type does not allow element "BR" here; assuming missing "LI" start-tag

How to do a list with is validated with HTML 4.01

I have something like this, but I get an error :( document type does not allow element "BR" here; assuming missing "LI" start-tag

<tr> 
<td colspan="2"> 
    <ol>
        <li><b>All</b>
        <br><br>
            <ol class="examplecalss">
                <li><a href="1.htm">exampletekst</a></li>
                <li><a href="2.htm">exampletekst</a></li>
                <li><a href="3.htm">exampletekst</a></li>
            </ol>
        </li>
        <br>
        <li>
        <b>exampletekst</b>
        <br><br>
            <ol class="examplecalss">
                <li><a href="4.htm">exampletekst</a></li>
                <li><a href="5.htm">exampletekst</a></li>
                <li><a href="6.htm">exampletekst</a><br>
                    <ul class="examplecalss">
                        <li><a href="7.htm">exampletekst</a></li>
                        <li><a href="8.htm">exampletekst</a></li>
                        <li><a href="9.htm">exampletekst</a></li>
                    </ul>
                </li>
                <li><a href="11.htm">exampletekst</a></li>
                <li><a href="12.htm">exampletekst</a></li>
                <li><a href="13.htm">exampletekst</a></li>
                </ol>
        </li>
        <br>

    </ol>
</td>

Upvotes: 0

Views: 2493

Answers (2)

Stefan C
Stefan C

Reputation: 123

You can use css to make that space, like this: ol>li {padding-top: 10px}. I didn't understaind your question well.be more speciffic.

Upvotes: 1

Mr. Alien
Mr. Alien

Reputation: 157334

You cannot nest <br> as a direct child to ul element, only li can be nested inside ul or ol, any other tag will be considered as invalid.

Instead, move those br inside li else if you've control over CSS, you can simply remove them and use margin-top or margin-bottom for li to get similar effect.


If you cannot modify your HTML, you can use jQuery to remove br

$('ol > br').remove();

Demo

Upvotes: 1

Related Questions