ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

11-HTML List

In web browsers HTML lists appear as bulleted lines of text. HTML lists has 3 different types:  unordered lists (bullets), ordered lists (numbers), and definition lists (think: dictionaries).

 

This list tags such  as <ul> are the container elements for the list items <li>. These list tags are working behind the scenes to recognize the beginning and ending of an HTML list element.

Example of unordered list  tag <ul>

<ul>Sites
  <li>itsourcecode</li>
  <li>snappytrends</li>
  <li>snappymindz</li>
  <li>snappyinfos</li>
</ul>

Result:

    Sites

  • itsourcecode
  • snappytrends
  • snappymindz
  • snappyinfos

Example of unordered list  tag <ul> with different type of bullet:

<ul type="square">
<ul type="disc">
<ul type="circle">

An ordered list tag is stated using the <ol> tag, and the items are listed with numbers instead of bullets.

Example ordered list tags:

 
<ol>Mix Name
  <li>jano</li>
  <li>bebe</li>
  <li>janobe</li>
</ol>

Another example of  ordered list tags  that has a letter and Roman Numerals using the type attribute.

<ol type="A">
<ol type="a">
<ol type="I">
<ol type="i">

 

HTML definition lists <dl> have a unique array of tags and elements and the results of these listings are similar  in a dictionary.

  • <dl> – start of the list
  • <dt> – definition term
  • <dd> –  list item

Example:

<dl>
  <dt><b>Entourage</b></dt>
    <dd>a group of people attending.</dd>
  <dt><b>Firework</b></dt>
    <dd>a device containing gunpowder.</dd>
  </dt>
</dl>

 

Facebook Comments

Check Your Domain Ranking

Updated: October 26, 2015 — 3:26 am

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!