Tuesday, June 18, 2024

HTML-LISTS

 

HTML provides different types of lists for organizing content. Here’s a brief overview and examples for each type:

  • Unordered Lists (<ul>): are marked with bullet point.

<!DOCTYPE html>
<html>
<head>
<title>Unordered List Example</title>
</head>
<body>
<h2>Fruits</h2>
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
</ul>
</body>
</html>

 

  • Ordered Lists (<ol>): are marked with the numbers.

<!DOCTYPE html>
<html>
<head>
<title>Ordered List Example</title>
</head>
<body>
<h2>Steps to Make a Sandwich</h2>
<ol>
<li>Take two slices of bread.</li>
<li>Spread peanut butter on one slice.</li>
<li>Spread jelly on the other slice.</li>
<li>Put the slices together.</li>
</ol>
</body>
</html>

 

  • Definition Lists (<dl>): Definition lists are used for terms and their definitions. They are useful for glossaries or descriptions.

<!DOCTYPE html>
<html>
<head>
<title>Definition List Example</title>
</head>
<body>
<h2>Web Terminology</h2>
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language, the standard language for creating web pages.</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets, used to style and layout web pages.</dd>
<dt>JavaScript</dt>
<dd>A programming language commonly used to create interactive effects within web browsers.</dd>
</dl>
</body>
</html>






No comments:

Post a Comment