Unordered List Inside Ordered List Last Updated : 14 Jan, 2025 Comments Improve Suggest changes Like Article Like Report Unordered List Inside Ordered List refers to a nested structure where an unordered list is placed within an ordered list. It is used when you want to combine numbered items (ordered list) with items that don’t have a particular sequence or hierarchy (unordered list). HTML <ol> <li>First Step <ul> <li>Substep A</li> <li>Substep B</li> </ul> </li> <li>Second Step <ul> <li>Substep X</li> <li>Substep Y</li> </ul> </li> </ol> Now let's see some of the use cases of the Unordered list inside the Ordered list1. Custom Numbering with Square Bullets HTML <!--Driver Code Starts--> <html> <head> <!--Driver Code Ends--> <style> ol { counter-reset: section; list-style-type: none; } ol>li { counter-increment: section; margin: 10px 0; } ol>li::before { content: "Section " counter(section, upper-roman) ". "; font-weight: bold; color: #3f51b5; } ul { list-style-type: none; padding-left: 20px; } ul>li { position: relative; margin: 8px 0; } ul>li::before { content: "\25A0"; position: absolute; left: -20px; top: 0; font-size: 18px; color: #ff5722; } </style> <!--Driver Code Starts--> </head> <body> <ol> <li> Introduction <ul> <li>What is the topic?</li> <li>Why is it important?</li> </ul> </li> <li> Body <ul> <li>Main argument</li> <li> Supporting evidence <ul> <li>Example 1</li> <li>Example 2</li> </ul> </li> </ul> </li> </ol> </body> </html> <!--Driver Code Ends--> In this exampleOrdered List: Sections are numbered using Roman numerals, prefixed with "Section" and colored blue.Unordered List: Custom orange square bullets are used instead of the default, and the list is indented.Nested Lists: Unordered lists inside the ordered list show subtopics with custom bullets.2. Customize bullets and numbers HTML <!--Driver Code Starts--> <html> <head> <!--Driver Code Ends--> <style> ol { list-style-type: upper-roman; margin: 20px; padding-left: 40px; } ul { list-style-type: square; margin: 10px 0 10px 20px; } </style> <!--Driver Code Starts--> </head> <body> <h1>Customized Nested Lists</h1> <ol> <li>Step One <ul> <li>Sub-step A</li> <li>Sub-step B</li> </ul> </li> <li>Step Two</li> <li>Step Three <ul> <li>Sub-step C</li> <li>Sub-step D</li> </ul> </li> </ol> </body> </html> <!--Driver Code Ends--> In this exampleHTML Structure: Create an ordered list (<ol>) and nest unordered lists (<ul>) inside specific <ol> items to form a hierarchy.CSS Customization: Use list-style-type to define the numbering style for <ol> (e.g., upper-roman) and bullet style for <ul> (e.g., square).Indentation: Adjust margin and padding in CSS for proper alignment of nested lists.Styling Flexibility: Easily modify list styles or colors for bullets and numbers to fit design needs.3. Adding custom bullet points or numbers.We are creating a nested list where an unordered list (<ul>) with custom bullet points (e.g., stars or squares) is placed inside an ordered list (<ol>) with custom numbering (e.g., Roman numerals or alphabets). HTML <!--Driver Code Starts--> <html> <head> <!--Driver Code Ends--> <style> ol { list-style-type: upper-roman; margin: 20px; padding-left: 40px; } ul { list-style-type: square; margin: 10px 0 10px 20px; } ul.custom-bullets li::before { content: '★'; margin-right: 8px; color: orange; } </style> <!--Driver Code Starts--> </head> <body> <h1>Nested Lists with Custom Bullets</h1> <ol> <li>Step One</li> <li>Step Two <ul class="custom-bullets"> <li>Sub-step A</li> <li>Sub-step B</li> </ul> </li> <li>Step Three</li> </ol> </body> </html> <!--Driver Code Ends--> In this exampleOrdered List: Uses Roman numerals (upper-roman) for numbering.Unordered List: Default bullets replaced with custom stars (★) using ::before.Styling: Colors, margins, and bullet types can be adjusted for visual appeal. Comment More infoAdvertise with us Next Article Unordered List Inside Ordered List T tanmxcwi Follow Improve Article Tags : HTML HTML5 HTML-Basics Similar Reads Unordered, Ordered, and Description Lists in HTML Lists are used to store data or information in web pages in ordered or unordered form. HTML supports several types of list elements that can be included in the <BODY>tag of the document. These elements may also be nested, i.e., the onset of elements can be embedded within another. There are th 5 min read Unordered List Inside Description List An unordered list inside a description list is a way to organize and present information in HTML where a description list(<dl>) contains unordered lists (<ul>) within its description definitions (<dd>). This allows for a term to be defined and followed by additional, detailed point 3 min read Ordered List Inside Description List Combination of Ordered List <ol> within a Description List <dl> is an effective way to present terms and their sequentially structured details. This combination is especially useful for showcasing processes, steps, or rankings associated with specific terms.HTML<html> <head> 4 min read How to Create an Unordered List in HTML ? An unordered list in HTML is a collection of items displayed with bullet points. To create an unordered list, we can use the <ul> tag to start the list and <li> tags for each items. Unordered lists are usually displayed with bullet points. Syntax<ul> <li>apple</li> < 1 min read HTML Unordered Lists An unordered list in HTML is used to group a set of list items that don't need to be in a specific order. The items in an unordered list are usually displayed with bullet points by default. Here are the some key features of HTML unordered lists:No Order: Lists items without a specific sequence.Custo 4 min read Like