htmllisthtml-lists

Why does my OL appear to be under my DD in this list markup?


Am I doing something wrong? In this image, it appears as if the ol is part of the term 1 description, but on my coding it's not.

example

my code:

<dl>
    <dt>term 1 (definition list)</dt>
    <dd>term 1 description</dd>
</dl>
    <ol>
        <li>ol list item 1</li>
        <li>ol list item 2
            <ul>
                <li>ul list item 1</li>
                <li>ul list item 2</li>
            </ul>
        </li>
    </ol>

I'm not using any CSS


Solution

  • You're doing nothing wrong, it just looks that way in display. I've added a second element named "term2" in example below, and you can clearly see the elements are seperated. I'm sure it will look much more decent once you style it properly.

    Example