Showing posts with label html list tag. Show all posts
Showing posts with label html list tag. Show all posts

Thursday, October 6, 2022

html List attributes tag


List Tag


Html List Tag


Lists Tag



List is a method that HTML offers for specifying any information or data in list style on web page. All lists can contain one or more heading or text. In a web page, list items like headings or any text starts with <li> and ends with </li>. But before writing any list item, it must to specify the list type. There are three types of lists you can use.

A list is a record of short pieces of related information or used to display the data or any information on web pages.
The <li> HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list ( <ol> ), an unordered list ( <ul> ), or a menu ( <menu> ). In menus and unordered lists, list items are usually. 



Three Types of Lists 

1) Unordered List  <ul>
2) Ordered List <ol>
3)Definition List <dl>


1) Unordered List


Unordered List <ul>: This will list items using plain bullets. An unordered list is a collection of elated items that have no special order or sequence. This list is created by using <ul> tag and ends with </ul> tag. Each item in the list is marked with a bullet. You can use type attribute for <ul> tag.


<ul type="square">

<ul type="disc">

<ul type="circle">

Program 

<!Doctype html>
<HTML>
<body>
<h1>  Unordered List</h1>
<ul>
<li>CPU Register</li>
 <li>Cache Memory</li>
<li>Primary Memory</li>
</ul>
<ul type="circle"> 
<li>Hard disk</li>
<li>CD/DVD</li> 
<li>Pend Drive</li>
</ul>
type="square">
<li>RAM</li>
<li>SRAM</li>
<li>DRAM</li>
</body>
</html>


Unordered List Output



Unordered List tag



2) Ordered List


This will use different schemes of numbers to list your items. If you are required to put your items in a numbered list then HTML ordered list will be used. This list is created by using <ol> tag and ends with </ol> tag. The numbering starts at one and is incremented by one for each successive ordered list element tagged with <li> and ends with </li>

Following are the possible options

<ol type="1"> - Default-Case Numbers. 
<ol type="I"> - Upper-Case Roman Numbers.
<ol type="i"> - Lower Case Numbers.
<ol type ="a"> - Lower case Letters.
<ok type= "A"> - Lower Case Letters.


Program 

<! Doctype html>
<HTML>
<body>
<h1> Ordered List</h1>
<ol type="1" start="1">
<li>Water</li>
<li>Food</li>
<li>Water</li>
</ol>
<ol type="A" start="5">
 <li>Students</li>
<li>sanskar</li>
<li>Education</li>
</ol>
<ol type="I" start="5">
<li>Technology</li>
<li>Science</li>
<li>Maths</li>
</0l>
</body>
</html>


Ordered List Output


Ordered List tag

3) Definition  list


Definition List <dl> HTML and XHTML support a list style which is called definition lists where entries are listed like in a dictionary or encyclopedia. The definition list is the ideal way to present a glossary, list of terms, or other name/value list.

Program 

<!DOCTYPE html>
<html>
<head>
<title> Definition List</title>
</head>
 <body>
<dl>
<dt><b>HTML</b></dt>
<dd>This stands for Hyper Text Markup
Language</dd>
<dt><b>HTTP</b></dt>
<dd>This stands for Hyper Text Transfer
Protocol</dd>
</d1>
</body>
</html>


Definition List Output


Definition list Tag


Visit This Link
To Your extra information