• HTML Tag »
  • Skip to content HTML / Lists Bring Order To Web Pages: Here’s The HTML Code To Create Them / <li> HTML TagDisclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn moreElement ofLists Bring Order To Web Pages: Here’s The HTML Code To Create ThemWhat does <li> HTML Tag do?The <li> element defines a list item that is part of an ordered and unordered list of items.DisplayblockUsagetextual

    Contents

    • 1 Code Example
    • 2 Display is based on list type
    • 3 Browser Support for li
    • 4 Attributes of li

    Code Example

    <ol> <li>First we do this,</li> <li>and then we do this,</li> <li>and then we do this.</li> </ol>
    1. First we do this,
    2. and then we do this,
    3. and then we do this.

    Display is based on list type

    An <li> element must be a child element to either an <ol> (ordered list) element or a <ul> (unordered list) element. The <ol> defines a list with some kind of numbering system, so the list items within it will normally be prepended with a number, a Roman numeral, or a letter. The <ul> list is almost always bulleted. List items are block-level elements and contain flow content — which means (among other things) that ehy can have other lists as their content. This is how you build a nested, or multi-level list (such as outline).

    <ul> <li>Things I want my son to know <ul> <li>Intangibles <ul> <li>Love</li> <li>Security</li> <li>Happiness</li> </ul> </li> <li>Tangibles <ul> <li>Colors <ul> <li>Red</li> <li>Blue</li> <li>Green</li> <li>Purple</li> <li>Orange</li> <li>Yellow</li> </ul> </li> <li>Numbers</li> <li>Letters</li> <li>Table Manners</li> </ul> </li> </ul> </li> </ul>
    • Things I want my son to know
      • Intangibles
        • Love
        • Security
        • Happiness
      • Tangibles
        • Colors
          • Red
          • Blue
          • Green
          • Purple
          • Orange
          • Yellow
        • Numbers
        • Letters
        • Table Manners
    Adam WoodAdam is a technical writer who specializes in developer documentation and tutorials.

    Browser Support for li

    iefirefoxchromeedgesafariopera
    AllAllAllAllAllAll

    Attributes of li

    Attribute nameValuesNotes
    valueSpecifies the counter value for a list item within a numbered list.
    typeSpecifies the bullet or numbering style for an individual list item.

    Post navigation

    How To Use In HTML<td nowrap>

    Search HTML.com

    Search for:

    Most Popular

    • <var> HTML Tag651 views
    • What Is Doxing? (And Why Is It So Scary?): An Infographic67 views
    • <meter> HTML Tag65 views
    • The Web Worker's Stress Busting Toolbox: 50 Tips to Improve Your Life65 views
    • <rp> HTML Tag29 views
    We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok

    Tag » What Is Li In Html