Unordered List Inside Ordered List Last Updated : 14 Jan, 2025 Summarize Comments Improve Suggest changes Share 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 T tanmxcwi Follow Improve Article Tags : HTML HTML5 HTML-Basics Similar Reads HTML Tutorial HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript 11 min read HTML Interview Questions and Answers HTML (HyperText Markup Language) is the foundational language for creating web pages and web applications. Whether you're a fresher or an experienced professional, preparing for an HTML interview requires a solid understanding of both basic and advanced concepts. Below is a curated list of 50+ HTML 14 min read Top 10 Projects For Beginners To Practice HTML and CSS Skills Learning to code is an exciting journey, especially when stepping into the world of programming with HTML and CSSâthe foundation of every website you see today. For most beginners, these two building blocks are the perfect starting point to explore the creative side of web development, designing vis 8 min read HTML Introduction HTML stands for Hyper Text Markup Language, which is the core language used to structure content on the web. It organizes text, images, links, and media using tags and elements that browsers can interpret. As of 2025, over 95% of websites rely on HTML alongside CSS and JavaScript, making it a fundam 6 min read HTML Tags - A to Z List HTML Tags are fundamental elements used to structure and format content on web pages. They provide instructions to web browsers on how to render text, images, links, and other media.HTML tags are enclosed in angle brackets < > and usually come in pairs: an opening tag and a closing tag. The cl 15+ min read 30+ Web Development Projects with Source Code [2025] Web development is one of the most in-demand career paths in the IT industry, experiencing consistent growth of around 20â25% annually. Whether you're a student starting out or an experienced professional looking to switch or advance your career, it's essential to go beyond theory and demonstrate yo 4 min read Frontend Developer Interview Questions and Answers Frontend development is an important part of web applications, and it is used to build dynamic and user-friendly web applications with an interactive user interface (UI). Many companies are hiring skilled Frontend developers with expertise in HTML, CSS, JavaScript, and modern frameworks and librarie 15+ min read HTML DOCTYPE Declaration HTML DOCTYPE (Document Type Declaration) is an instruction that appears at the beginning of an HTML document, before the <html> tag.Its primary role is to tell the web browser which version of HTML the page is written in, ensuring that the browser renders the content correctly. It is not an HT 4 min read HTML Forms HTML forms, defined using the <form> Tags are essential for collecting user input on web pages. They incorporate a variety of interactive controls such as text fields, numeric inputs, email fields, password fields, checkboxes, radio buttons, and submit buttons. Over 85% of websites rely on for 5 min read HTML Tables HTML (HyperText Markup Language) is the standard markup language used to create and structure web pages. It defines the layout of a webpage using elements and tags, allowing for the display of text, images, links, and multimedia content. As the foundation of nearly all websites, HTML is used in over 10 min read Like