Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
Unordered List Inside Description List
Next article icon

Unordered List Inside Description List

Last Updated : 14 Jan, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

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 points or subitems presented as a bulleted list.

HTML
<!--Driver Code Starts--> <html> <head></head> <body>     <h2>Welcome To GFG</h2> <!--Driver Code Ends-->      <dl>         <dt>Web Development</dt>         <dd>             The process of building and maintaining websites. It involves:             <ul>                 <li>Front-end development</li>                 <li>Back-end development</li>                 <li>Database management</li>             </ul>         </dd>     </dl>  <!--Driver Code Starts--> </body> </html> <!--Driver Code Ends--> 

Nested multiple unordered lists inside a description list

Create nested multiple unordered lists inside a description list, you can embed multiple <ul> elements within <dd> tags, with each unordered list potentially containing another list

HTML
<dl>   <dt>Shopping List</dt>   <dd>     <ul>       <li>Fruits         <ul>           <li>Apples</li>           <li>Bananas</li>         </ul>       </li>       <li>Vegetables</li>     </ul>   </dd> </dl> 

Customize bullets and numbers

HTML
<!--Driver Code Starts--> <html> <head> <!--Driver Code Ends-->      <style>         ul.custom-bullets {             list-style-type: square;         }         ul.custom-bullets li {             font-size: 18px;         }         dl {             font-family: Arial, sans-serif;         }         dt {             font-weight: bold;         }         dd {             padding-left: 20px;         }         ol.custom-numbers {             list-style-type: upper-roman;         }     </style>  <!--Driver Code Starts--> </head> <body>     <dl>         <dt>Tasks</dt>         <dd>             <ul class="custom-bullets">                 <li>Buy groceries</li>                 <li>Complete homework</li>                 <li>Clean the house</li>             </ul>         </dd>         <dt>Steps</dt>         <dd>             <ol class="custom-numbers">                 <li>Prepare ingredients</li>                 <li>Mix ingredients</li>                 <li>Cook</li>             </ol>         </dd>     </dl> </body> </html> <!--Driver Code Ends--> 

In this example

  • Unordered List Bullets: The bullets in the unordered list are customized to be square using list-style-type: square;.
  • Ordered List Numbers: For the ordered list, the numbers are customized to Roman numerals using list-style-type: upper-roman;.
  • CSS Styling: The description list (<dl>) and list items (<dt>, <dd>) are styled with padding and font adjustments for clarity.

Nested multiple unordered lists inside a description list

Create nested multiple unordered lists inside a description list, you can structure the HTML by including multiple levels of <ul> elements within the <dd> tags

HTML
<!--Driver Code Starts--> <html> <head>     <style>         ul.custom-bullets {             list-style-type: circle;             font-size: 18px;         }         ul.custom-bullets li {             margin-bottom: 8px;         }         ul.custom-bullets ul {             list-style-type: square;             margin-left: 20px;         }         dl {             font-family: Arial, sans-serif;         }         dt {             font-weight: bold;         }         dd {             padding-left: 20px;         }     </style> </head> <body> <!--Driver Code Ends-->      <dl>         <dt>Shopping List</dt>         <dd>             <ul class="custom-bullets">                 <li>Fruits                     <ul>                         <li>Apples</li>                         <li>Bananas</li>                     </ul>                 </li>                 <li>Vegetables                     <ul>                         <li>Carrots</li>                         <li>Spinach</li>                     </ul>                 </li>                 <li>Snacks                     <ul>                         <li>Chips</li>                         <li>Cookies</li>                     </ul>                 </li>             </ul>         </dd>     </dl>  <!--Driver Code Starts--> </body> </html> <!--Driver Code Ends--> 

In this example

  • Nested Unordered Lists: The main <ul> list is nested inside the <dd>, with each list item containing another <ul>. This creates a hierarchical structure where sub-items (like "Apples" and "Bananas") appear under the main categories (like "Fruits").
  • Bullet Customization: The top-level unordered list uses circle bullets, while the nested lists use square bullets

Unordered list inside a description list with custom bullet points

An unordered list inside a description list allows you to present items with bullet points under a specific definition.

HTML
<!--Driver Code Starts--> <html> <head> <!--Driver Code Ends-->      <style>         ul.custom-bullets {             list-style-type: square;         }     </style>  <!--Driver Code Starts--> </head> <body>     <dl>         <dt>Shopping List</dt>         <dd>             <ul class="custom-bullets">                 <li>Fruits</li>                 <li>Vegetables</li>                 <li>Dairy</li>             </ul>         </dd>     </dl> </body> </html> <!--Driver Code Ends--> 

In this example

  • Custom Bullets: The unordered list uses square bullets by setting list-style-type: square; in the CSS.
  • Description List: The unordered list is placed inside the <dd> tag of a description list (<dl>).

Nested unordered list with Roman numerals

This refers to a description list (<dl>) where each item contains an unordered list (<ul>) with nested list items styled with Roman numerals

HTML
<!--Driver Code Starts--> <html> <head> <!--Driver Code Ends-->      <style>         ul.roman-numerals {             list-style-type: upper-roman;         }          ul.roman-numerals ul {             list-style-type: lower-alpha;             margin-left: 20px;         }     </style>  <!--Driver Code Starts--> </head> <body>     <dl>         <dt>Shopping List</dt>         <dd>             <ul class="roman-numerals">                 <li>Fruits                     <ul>                         <li>Apples</li>                         <li>Bananas</li>                     </ul>                 </li>                 <li>Vegetables</li>             </ul>         </dd>     </dl> </body> </html> <!--Driver Code Ends--> 

In this example

  • The code creates a description list (<dl>) with a nested unordered list (<ul>) inside the <dd> element.
  • The outer list items are numbered with Roman numerals (I, II, III) using list-style-type: upper-roman.
  • The nested list inside "Fruits" useslowercase letters (a, b, c) by applying list-style-type: lower-alpha and adding indentation for clarity.

Next Article
Unordered List Inside Description List

T

tanmxcwi
Improve
Article Tags :
  • HTML
  • HTML5
  • HTML-Basics

Similar Reads

    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
    Unordered List Inside Ordered List
    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 St
    3 min read
    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
    Explain Description Lists in HTML
    An HTML description list is a list of terms, with a description of each term. The HTML description list is represented as <dl>. Lists in HTML are used for specifying particular information in list form. There are various types of Lists in Html such as Ordered Lists, Unordered Lists, and descri
    2 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
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences