What is Nested List in Html


 

Nested List 


A nested List means to create another List inside a List. In simple words, you can define OL in a UL. And UL can be defined in an OL.


Check it.


Copy the HTML code given below and paste it into your notepad++ or by typing this code with your hands, save the file as nestedlist.html And open it.



<!DOCTYPE html>
<html>
<head>
<title>HTML Nested List </title><body>
<ol>
<li>Front End Developer
<ul>
<li>HTML</li>
<li>CSS</li>
</ul>
</li>
<li>Back End Developer
<ol type=”1”>
<li>PHP</li>
<li>Mysql</li>
</ol>
</ol>
</body>
</html>

When you will see the above code in the browser, you will see a result like this.




  1. Front End Developer
  • HTML
  • CSS 
     2. Back End Developer
     1. PHP
     2. Mysql


Seeing the above example, you must have understood how a Nested List is created. You must have noticed that by opening a List Item, another List has been defined inside it. Then that List Item is closed. This is how Nested Lists are created in HTML.

Post a Comment

0 Comments