Frames and Lists in HTML - Working with Nested Lists
(Page 6 of 6 )
It is possible to nest a list within a list. Let's say you are listing different food groups. The food group Fruit would have a break down or subcategory of different types of fruit. Observe:
<html>
<body>
<h3>How to Create A Nested List:</h3>
<ul>
<li>Fruit</li>
<ul>
<li>Apples</li>
<li>Bananas</li>
</ul>
</li>
</ul>
<ul>
<li>Vegetables</li>
<ul>
<li> Asparagus</li>
<li> Brocoli</li>
</ul>
</body>
</html>
The result:
How to Create A Nested List:
And lastly, the Definition List…
The Definition List
The Definition list is not a list of data, but rather a list of terms and their well…definitions. Here is how you code it:
<html>
<body>
<h3>To Create A Definition List:</h3>
<dl>
<dt><b>Cheese</b></dt>
<dd>A dairy byproduct of milk</dd>
<dt><b>James</b></dt>
<dd>A human byproduct of Awesomeness</dd>
</dl>
</body>
</html>
The result of this brilliant code:
To Create A Definition List:
Cheese
A dairy byproduct of milk
James
A human byproduct of Awesomeness
Well that’s it for this tutorial. Join us next time as we discuss how to work with tables in HTML.
Till then…
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |