Lists in html

HTML lists are created using the ol and ul tags.
ol is for ordered lists, while ul is for unordered lists.

The ul list uses the  type attribute to define the list type. Possible values are.
disc Sets the list item marker to a bullet (default)
circle Sets the list item marker to a circle
square Sets the list item marker to a square
none The list items will not be marked

<ul type="disc">
<li>One</li>
<li>Two</li>
<li>Three </li>
<li>Four</li>
</ul>

ol or oredered list has the following options

type=”1″ The list items will be numbered with numbers (default)
type=”A” The list items will be numbered with uppercase letters
type=”a” The list items will be numbered with lowercase letters
type=”I” The list items will be numbered with uppercase roman numbers
type=”i” The list items will be numbered with lowercase roman numbers


<ol type="1">
<li>One</li>
<li>Two</li>
<li>Three </li>
<li>Four</li>
</ol>

start can be used to define a new starting point.


<ol start="50" type="1">
<li>One</li>
<li>Two</li>
<li>Three </li>
<li>Four</li>
</ol>

 

HTML also supports description lists


<dl>
<dt>Varanasi</dt>
<dd>-City in UP</dd>
<dt>Patna</dt>
<dd>- City in Bihar</dd>
</dl>

 

The select tag


<select>
<option>Jan</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>Jun</option>
<option>Jul</option>
<option>Aug</option>
<option>Sep</option>
<option>Oct</option>
<option>Nov</option>
<option>Dec</option>
</select>

The selected attribute is used to define a pre selected item. The size attribute defines the number of visible elements. Default value is one.

 

Leave a Reply