Lists In HTML
LISTS IN HTML
LISTS:
HTML supports several types of list elements that are included with in the BODY tag of the Document.
These elements may be Nested, one set of elements may be embedded within another set of elements.
LIST ITEM <LI> TAG:
A List Item tag <LI> is used to define a each item of list. This tag is an empty tag, it has an ON tag but does not require an OFF tag. Once the Items are defined using the <LI> tag, the list (by DEFAULT) appears as bullets form in the web browser.
<!DOCTYPE html>
<html>
<body>
<h2>An HTML list</h2>
<li>Coffee
<li>Tea
<li>Milk
</body>
</html>
Output:
An HTML list
Different types of lists can be created in an HTML document. They are:
1. Unordered List
2. Ordered List
3.Definition List
UNORDERED LIST <UL> TAG:
an unordered list is used for items in which the ordering is not specific. The list items are defined using the <UL> and </UL> tags.
Each item in the list is defined using the <LI> tag. The bullet style can be added to the list items by
<UL TYPE = 'CIRCLE'/ 'DISC' / 'SQUARE'>
Where, circle specifies a hollow bullet
disc specifies a solid round bullet
square specifies a square bullet.
An unordered list is also called bulleted list.
<!DOCTYPE html>
<html>
<body>
<h2>An unordered HTML list</h2>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Output:
An unordered HTML list
- Coffee
- Tea
- Milk
Square unordered LIST:
<!DOCTYPE html>
<html>
<body>
<h2>Unordered List with Square Bullets</h2>
<ul style="list-style-type:square">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Output:
An unordered HTML list
- Coffee
- Tea
- Milk
Circle unordered LIST:
<!DOCTYPE html>
<html>
<body>
<h2>Unordered List with Circle Bullets</h2>
<ul style="list-style-type:circle">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Output:
Unordered List with Circle Bullets
- Coffee
- Tea
- Milk
Disc unordered LIST:
<!DOCTYPE html>
<html>
<body>
<h2>Unordered List with Disc Bullets</h2>
<ul style="list-style-type:disc">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Output:
Unordered List with Disc Bullets
- Coffee
- Tea
- Milk
unordered LIST as NONE:
<!DOCTYPE html>
<html>
<body>
<h2>Unordered List without Bullets</h2>
<ul style="list-style-type:none">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Unordered List without Bullets
- Coffee
- Tea
- Milk
Comments
Post a Comment