Jump to content

ul child of ul


anmldr

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 comment
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>

can i do the same with a dl tag?and how?
Link to comment
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 comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...