html List attributes tag
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 tag is a record of short pieces of related information or used to display data or any information on web pages.
The <li> tag HTML element is used to the represent item in list. list tag It must be contained in a parent element an ordered list ( <ol> )tag an unordered list ( <ul> ), or a menu ( <menu> ). list tag 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
HTML -Unordered List <ul>:- This list items using plained 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 of the list is marked with bullet. You can used type of 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
2) Ordered List
order list different schemes of numbers list your items. If you are require to put your item in numbered of list then HTML ordered list will be used. This list is created by using <ol> tag and ends with </ol> tag. The numbering start at one and incremented by the one for each successive ordered list element tagged with <li> tag 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
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 ideal way present 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>
Post a Comment