How do you create an ordered list in HTML?

HTML Ordered Lists

❮ Previous Next ❯

The HTML

    tag defines an ordered list. An ordered list can be numerical or alphabetical.

    HTML Lists

    ❮ Previous Next ❯

    HTML lists allow web developers to group a set of related items in lists.

    Example

    An unordered HTML list:

    • Item
    • Item
    • Item
    • Item

    An ordered HTML list:

    1. First item
    2. Second item
    3. Third item
    4. Fourth item
    Try it Yourself »

    How to create an ordered list with list items numbered with numbers in HTML?

    HTMLWeb DevelopmentFront End Technology

    To create ordered list in HTML, use the

      tag. Ordered list starts with the
        tag. The list item starts with the
      1. tag and will be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default numbers for list items.

        For creating an ordered list with numbers, use the

          tag attribute type. This attribute will assign the value number i.e.
            to create ordered list numbered with numbers.

              : The Ordered List element

            The

              HTML element represents an ordered list of items — typically rendered as a numbered list.

              Content categoriesPermitted contentTag omissionPermitted parentsImplicit ARIA rolePermitted ARIA rolesDOM interface
              Flow content, and if the
                element's children include at least one
              1. element, palpable content.
              Zero or more
            1. , and elements.
            2. None, both the starting and ending tag are mandatory.
              Any element that accepts flow content.
              list
              directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree
              HTMLOListElement

            HTML Lists

            In this tutorial you will learn how to create different types of lists in HTML.

            HTML Ordered List | HTML Numbered List

            HTML Ordered List or Numbered List displays elements in numbered format. The HTML ol tag is used for ordered list. We can use ordered list to represent items either in numerical order format or alphabetical order format, or any format where an order is emphasized. There can be different types of numbered list:

            • Numeric Number [1, 2, 3]
            • Capital Roman Number [I II III]
            • Small Romal Number [i ii iii]
            • Capital Alphabet [A B C]
            • Small Alphabet [a b c]

            To represent different ordered lists, there are 5 types of attributes in

              tag.

              TypeDescription
              Type "1"This is the default type. In this type, the list items are numbered with numbers.
              Type "I"In this type, the list items are numbered with upper case roman numbers.
              Type "i"In this type, the list items are numbered with lower case roman numbers.
              Type "A"In this type, the list items are numbered with upper case letters.
              Type "a"In this type, the list items are numbered with lower case letters.

              Creating Lists

Lists are a part of everyday life. To-do lists determine what to get done. Navigational routes provide turn-by-turn lists of directions. Recipes provide lists of ingredients and lists of instructions. With a list for nearly everything, it’s easy to understand why they are also popular online.

When we want to use a list on a website, HTML provides three different types to choose from: unordered, ordered, and description lists. Choosing which type of list to use—or whether to use a list at all—comes down to the content and the most semantically appropriate option for displaying that content.

In addition to the three different types of lists available within HTML, there are multiple ways to style these lists with CSS. For example, we can choose what type of marker to use on a list. The marker could be square, round, numeric, alphabetical, or perhaps nonexistent. Also, we can decide if a list should be displayed vertically or horizontally. All of these choices play significant roles in the styling of our web pages.

Video liên quan

Bài mới nhất

Chủ Đề