Student: Majharul Islam | ID: 232002256 | Date: October 2025
HTML lists are used to group related items together. There are three main types: unordered lists (<ul>), ordered lists (<ol>), and description lists (<dl>).
| List Type | Element | Purpose | Default Marker |
|---|---|---|---|
| Unordered List | <ul> | Items without specific order | Bullet points |
| Ordered List | <ol> | Items with specific sequence | Numbers |
| Description List | <dl> | Term-definition pairs | No markers |
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
<ul type="square">
<li>Web Development</li>
<li>Mobile Development</li>
<li>Desktop Applications</li>
</ul>
<ul type="circle">
<li>Frontend Technologies</li>
<li>Backend Technologies</li>
<li>Database Management</li>
</ul>
<ul style="list-style-type: none;">
<li>Plain List Item 1</li>
<li>Plain List Item 2</li>
<li>Plain List Item 3</li>
</ul>
<ol>
<li>Plan the project</li>
<li>Design the interface</li>
<li>Write the code</li>
<li>Test and debug</li>
</ol>
<ol type="I">
<li>Introduction</li>
<li>Background</li>
<li>Methodology</li>
<li>Results</li>
</ol>
<ol type="a">
<li>First option</li>
<li>Second option</li>
<li>Third option</li>
<li>Fourth option</li>
</ol>
<ol start="10">
<li>Advanced HTML Concepts</li>
<li>CSS Grid Mastery</li>
<li>JavaScript ES6+</li>
<li>React Framework</li>
</ol>
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dd>Used for creating web page structure</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
<dd>Used for styling web pages</dd>
<dt>JavaScript</dt>
<dd>Programming language for web interactivity</dd>
<dd>Runs in the browser and on servers</dd>
</dl>
<ol>
<li>Frontend Development
<ul>
<li>HTML5
<ul>
<li>Semantic Elements</li>
<li>Forms and Input Types</li>
</ul>
</li>
<li>CSS3</li>
</ul>
</li>
<li>Backend Development</li>
</ol>
| Attribute | Description | Example |
|---|---|---|
| type | Numbering type (1, a, A, i, I) | <ol type="a"> |
| start | Starting number | <ol start="5"> |
| reversed | Reverse numbering order | <ol reversed> |
| Attribute | Description | Example |
|---|---|---|
| value | Set specific number for list item | <li value="10"> |
| type | Override list type for this item | <li type="a"> |
<ol start="5">
<li>Item 5</li>
<li value="10">Item 10 (custom value)</li>
<li>Item 11</li>
<li value="50">Item 50 (custom value)</li>
<li>Item 51</li>
</ol>
| Property | Description | Example |
|---|---|---|
| list-style-type | Type of marker | list-style-type: square; |
| list-style-image | Custom marker image | list-style-image: url('bullet.png'); |
| list-style-position | Marker position (inside/outside) | list-style-position: inside; |
| list-style | Shorthand property | list-style: square inside; |
/* Custom List Styling */
ul.custom {
list-style-type: none;
padding: 0;
}
ul.custom li {
background: #f4f4f4;
margin: 5px 0;
padding: 10px;
border-left: 3px solid #3498db;
}
ul.custom li::before {
content: "▶";
color: #3498db;
font-weight: bold;
margin-right: 10px;
}
/* Nested List Styling */
ul.nested ul {
margin-left: 20px;
list-style-type: circle;
}
ul.nested ul ul {
list-style-type: square;
}
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li>
<a href="services.html">Services</a>
<ul>
<li><a href="web-design.html">Web Design</a></li>
<li><a href="development.html">Development</a></li>
<li><a href="maintenance.html">Maintenance</a></li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<article>
<h1>Chocolate Chip Cookies</h1>
<h2>Ingredients</h2>
<ul>
<li>2 cups all-purpose flour</li>
<li>1 tsp baking soda</li>
<li>1/2 tsp salt</li>
<li>1 cup butter, softened</li>
<li>3/4 cup granulated sugar</li>
<li>1 cup chocolate chips</li>
</ul>
<h2>Instructions</h2>
<ol>
<li>Preheat oven to 375°F (190°C)</li>
<li>Mix dry ingredients in a bowl</li>
<li>Cream butter and sugars together</li>
<li>Add eggs and vanilla</li>
<li>Gradually mix in flour mixture</li>
<li>Stir in chocolate chips</li>
<li>Drop rounded tablespoons onto ungreased cookie sheets</li>
<li>Bake for 9-11 minutes until golden brown</li>
</ol>
</article>
<section>
<h2>Frequently Asked Questions</h2>
<dl>
<dt>What is HTML?</dt>
<dd>HTML (HyperText Markup Language) is the standard markup language for creating web pages.</dd>
<dt>What is CSS?</dt>
<dd>CSS (Cascading Style Sheets) is used to style and layout web pages.</dd>
<dt>What is JavaScript?</dt>
<dd>JavaScript is a programming language that adds interactivity to web pages.</dd>
<dt>How do I learn web development?</dt>
<dd>Start with HTML basics, then move to CSS for styling, and finally JavaScript for interactivity.</dd>
<dd>Practice regularly and build projects to reinforce your learning.</dd>
</dl>
</section>