Hieu Hieu - 2 months ago 6
HTML Question

How can I add subtext in list?

http://fiddle.jshell.net/stealthpancakes/jvrqhxdk/5/

I tried to put text in div, but everything after Subtext_1 is displayed in block.

Upper_text_1
Subtext_1
Upper_text_2 Upper_text_3


<nav>
<ul>
<li><div>Upper_text_1</div><div>Subtext_1</div></li>
<li>Upper_text_2</li>
<li>Upper_text_3</li>
</ul>
</nav>


I want something like this:

http://i.imgur.com/rAe2i6H.png

Answer

That is because div is a block level tag, you can try sub instead

<nav>
    <ul>
        <li>Upper_text_1<br /><span>Subtext_1</span></li>
        <li>Upper_text_2<br /><span>Subtext_2</span></li>
        <li>Upper_text_3<br /><span>Subtext_3</span></li>
    </ul>
</nav>