Jump to content

ul child of ul

Recommended Posts

How do you create a valid ul within an ul?This is not valid:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title></title></head><body><ul>  <li>One</li>  <li>Two</li>  <ul>	<li>a</li>	<li>b</li>	<li>c</li>  </ul>  <li>Three</li>  <li>Four</li>  <ul>	<li>a</li>	<li>b</li>	<li>c</li>  </ul>  <li>Five</li></ul></body></html>

Link to post
Share on other sites

Nest them in the li tags:

<ul>  <li>One</li>  <li>Two<ul>	<li>a</li>	<li>b</li>	<li>c</li>  </ul></li>  <li>Three</li>  <li>Four<ul>	<li>a</li>	<li>b</li>	<li>c</li>  </ul></li>  <li>Five</li></ul>

Link to post
Share on other sites
can i do the same with a dl tag?and how?
Yep. Same principle. Just nest the dl within the dd tag:
<dl>  <dt>Item</dt>  <dd><dl>	<dt>Subitem</dt>	<dd>- subitem definition</dd>	<dt>Subitem</dt>	<dd>- subitem definition</dd>  </dl></dd>  <dt>Item</dt>  <dd>- item definition</dd></dl>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...