Use ul element to mark unordered list

Description

The ul element to denote unordered lists.

The items in the ul element are denoted using the li element.

The element doesn't define any attributes in HTML5 and you control the presentation of the list using CSS.

The type and compact attributes are obsolete in HTML5.

Example

You can see the ul element in use in the following code.


<!DOCTYPE HTML>
<html>
<body>
  I like:<!--from   www.  j  av  a 2  s . co  m-->
  <ul>
    <li>HTML</li>
    <li>CSS</li>
    <li>Javascript</li>
  </ul>
</body>
</html>

Click to view the demo

Each list item is displayed with a bullet. You can control which style bullet is used through the list-style-type CSS property.

Example 2

The following code shows how to create a nested list.


<!--from  ww  w.  j a v  a2s .  c  om-->
<!DOCTYPE HTML>
<html>
<body>
    <ul>
        <li>HTML</li>
        <li>CSS
            <ul>
                <li>Introdunction</li>
                <li>CSS attributes</li>
            </ul>
        </li>
        <li>Javascript</li>
    </ul>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed