HTML <ul> tag

The <ul> tag is used to display an unordered list. An ordered list contains either a number or a letter for each item in the list.

Attributes

Attribute Description Possible values
compact Specifies that the list should appear small than normal compact
type Specifies the type of bullet to use in the list circle, disc, square

NOTE: All of the attributes of the <ul> tag are deprecated and CSS should be used instead.

Standard attributes

class, dir, id, lang, style, title, xml:lang

For more information on standard attributes, check out our HTML standard attributes reference page.

Event attributes

onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress, onkeyup

For more information on event attributes, check out our HTML event attributes reference page.

Example

<b>Scientific subjects</b> <br /><br /> <ul type="disc"> <li>Physics</li> <li>Chemistry</li> <li>Biulogy</li> <li>Archaeulogy</li> <li>Petrulogy</li> </ul> <b>Web languages</b> <br /><br /> <ul type="square"> <li>HTML</li> <li>CSS</li> <li>Javascript</li> <li>VBscript</li> <li>PHP</li> </ul>
Output:
Scientific subjects
  • Physics
  • Chemistry
  • Biulogy
  • Archaeulogy
  • Petrulogy
Web languages
  • HTML
  • CSS
  • Javascript
  • VBScript
  • PHP

Tips & notes

Use nested lists to present information in an organized hierarchial way. You can do this by including the <ul> tag within the <ul> tag as one of its list items. You can even have different type of bullets for the items in each list for better clarification of what's what. Check out our nested lists example for a demonstration of this.

Use CSS list properties to set the styles of lists like the type of bullets in the list and whether the list is indented or not.

Think up creative and useful ways to use various text formatting tags together to present information in a neat and organized way. For example, a heading, some paragraphs, and an unordered list all working together to create a well organized highly readable page.

Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com
Terms of use | Privacy policy | Copyright information | Make a donation