What is the default type of list in HTML?

10 Lists

Contents

  1. Introduction to lists
  2. Unordered lists [UL], ordered lists [OL], and list items [LI]
  3. Definition lists: the DL, DT, and DD elements
    1. Visual rendering of lists
  4. The DIR and MENU elements

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 »

HTML Ordered Lists

❮ Previous Next ❯

The HTML

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

      : 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 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.

        HTML |
      1. type Attribute
      2. The

      3. type attribute in HTML is used to specify the type of a list items. This attribute also defines the style of the bullet point of the list items.

        Syntax:

      4. Attribute Values:
        For ordered list items:

        • 1: It is the default value. It is used to specify the numerical ordered list.
        • a: It arranged the list items in lower case letters.
        • A: It arrange the list items in the form of upper case.
        • i: It arrange the list items in the roman numbers in the form of lower case letters.
        • I: It arranged the list in roman numerals in the form of uppercase letters.

        For unordered list items:

        • disc: It is the default value. It creates a filled circle.
        • circle: It creates an unfilled circle.
        • square: It creates an filled square.

        Note: The

      5. type attribute is not supported by HTML 5.



        Example 1:

        HTML




        HTML li type Attribute

        GeeksforGeeks

        HTML list item type Attribute

        Sorting Algorithms

        1. Merge sort
        2. Quick sort
        3. Insertion sort

        Output:

        Example 2:

        HTML




        HTML li type Attribute

        GeeksforGeeks

        HTML li type Attribute

        Sorting Algorithms

        • Merge sort
        • Quick sort
        • Insertion sort

        Output:

        Supported Browsers: The browser supported by HTML

      6. type attribute are listed below:

        • Google Chrome
        • Internet Explorer
        • Firefox
        • Safari
        • Opera




        Article Tags :

        HTML

        Web Technologies

        HTML-Attributes

        Practice Tags :

        HTML

        Read Full Article

        HTML Lists

        In this article, we will know the HTML List, along with understanding its types, various ways to implement them, through the example.

        A list is a record of short pieces of related information or used to display the data or any information in web pages in the ordered or unordered form. For instance, to purchase the items, we need to prepare a list that can either be ordered or unordered list which helps us to organize the data & easy to find the item. Please refer to the HTML

      7. type Attribute article for the various types of attributes that can be used with the ordered & unordered list.

        Example: The below example illustrates the use of the unordered & ordered list in HTML.

        HTML




        GeeksforGeeks

        Welcome To GeeksforGeeks Learning

        List of available courses

        • Data Structures & Algorithm
        • Web Technology
        • Aptitude & Logical Reasoning
        • Programming Languages

        Data Structures topics

        1. Array
        2. Linked List
        3. Stacks
        4. Queues
        5. Trees
        6. Graphs

        Output:

        HTML List

        Supported Tags: These tags are used in HTML listing.



        • HTML
            Tag
          • HTML
              Tag
            1. HTML Tag

          The HTML Unordered List: An unordered list starts with the “ul” tag. Each list item starts with the “li” tag. The list items are marked with bullets i.e small black circles by default.

          Syntax:

            list of items

          Attribute: This tag contains two attributes which are listed below:

          • compact: It will render the list smaller.
          • type: It specifies which kind of marker is used in the list.

          Note: The

            attributes are not supported by HTML5.

            Example: This example describes the unordered list.

            HTML




            Grocery list

            • Bread
            • Eggs
            • Milk
            • Coffee

            Output:

            Unordered List

            HTML unordered list has various list item markers:

            Example 1: The Disc can be used to set the list item marker to a bullet i.e default.

            HTML




            HTML ul tag

            GeeksforGeeks

            Unordered List with Disc Bullets

            GeeksforGeeks courses List:

            • Geeks
            • Sudo
            • Gfg
            • Gate
            • Placement

            Output:

            Unordered List with disc item maker

            Example 2: The Circle can be used toset the list item marker to a circle.

            HTML




            GeeksforGeeks

            Unordered List with Circle Bullets

            GeeksforGeeks courses List:

            • Geeks
            • Sudo
            • Gfg
            • Gate
            • Placement

            Output:

            Unordered List with circle item maker

            Example 3: TheSquare can be used to set the list item marker to a square.

            HTML




            GeeksforGeeks

            Unordered List with Square Bullets

            GeeksforGeeks courses List:

            • Geeks
            • Sudo
            • Gfg
            • Gate
            • Placement

            Output:

            Unordered List with square item maker

            Example 4: It’s none that can be used to set the list item marker with no mark.

            HTML




            GeeksforGeeks

            Unordered List with No Bullets

            GeeksforGeeks courses List:

            • Geeks
            • Sudo
            • Gfg
            • Gate
            • Placement

            Output:

            Unordered List with none item maker

            Example: Nested Unordered List, It is used to nest the list items ie., list inside another list.

            HTML




            GeeksforGeeks

            Nested Unordered List

            GeeksforGeeks courses List:

            • DSA
              • Array
              • Linked List
              • stack
              • Queue

            • Web Technologies
              • HTML
              • CSS
              • JavaScript

            • Aptitude
            • Gate
            • Placement

            Output:

            Nested Unordered List

            HTML Ordered List: An ordered list starts with the “ol” tag. Each list item starts with the “li” tag. The list items are marked with numbers by default.

            Syntax:

            1. Item1
            2. Item2
            3. Item3

            Attributes:

            • compact: It defines the list should be compacted [compact attribute is not supported HTML5. Use CSS instead.].
            • reversed: It defines that the order will be descending.
            • start: It defines that from which number or alphabet the order will start.
            • type: It defines which type[1, A, a, I, and i] of the order you want in your list numeric, alphabetic, or roman numbers.

            Example:This example illustrates the use of the reverse attribute, control list counting & type attribute.

            HTML




            HTML ol tag

            GeeksforGeeks

            HTML ol tag

            reversed attribute

            1. HTML
            2. CSS
            3. JS

            start attribute

            1. HTML
            2. CSS
            3. JS

            type attribute

            1. HTML
            2. CSS
            3. JS

            Output:

            Ordered List with different list style

            HTML ordered list has various list item markers: The type attribute of the

              tag defines the type of the list item marker.

              Example 1: The list items will be numbered with numbers i.e default.

              HTML




              Ordered List with Numbers

              1. Bread
              2. Eggs
              3. Milk
              4. Coffee

              Output:

              Ordered List withnumeric item maker

              Example 2: Type=”A”, this list of items will be numbered with uppercase letters.

              HTML




              Ordered List with Letters

              1. Bread
              2. Eggs
              3. Milk
              4. Coffee

              Output:

              Ordered List withcapital alphabetic item maker

              Example 3: Type=”a”, this list items will be numbered with lowercase letters.

              HTML




              Ordered List with Lowercase Letters

              1. Bread
              2. Eggs
              3. Milk
              4. Coffee

              Output:

              Ordered List withsmall alphabetic item maker

              Example 4: Type=”I”, this list items will be numbered with uppercase roman numbers.

              HTML




              Ordered List with Roman Numbers

              1. Bread
              2. Eggs
              3. Milk
              4. Coffee

              Output:

              Ordered List withuppercase roman numbers

              Example 5: Type=”i”, this list items will be numbered with lowercase roman numbers.

              HTML




              Ordered List with Lowercase Roman Numbers

              1. Bread
              2. Eggs
              3. Milk
              4. Coffee

              Output:

              Ordered List withlowercase roman numbers

              Example 6: Nested ordered list, a nested ordered list is a list that has a list inside another list.

              HTML




              GeeksforGeeks

              Nested Ordered List

              1. Coffee
              2. Tea

                1. Black tea
                2. Green tea

              3. Milk

              Output:

              Nested Ordered List

              HTML Description List: A description list is a list of terms, with a description of each term.The tag defines the description list, the tag defines the term name, and the tag describes each term.Please refer to the How to add description list of an element using HTML? article for further details.

              Syntax:

              Contents...

              Example: This example describes the HTML Description List.

              html




              A Description List

              Coffee

              - 500 gms

              Milk

              - 1 ltr Tetra Pack

              Output:

              Description List

              Supported Browser:

              • Google Chrome 94.0 & above
              • Microsoft Edge 93.0
              • Firefox 92.0 & above
              • Opera 78.0
              • Safari 14.1
              • IE 11.0




              Article Tags :

              HTML

              Technical Scripter

              Web Technologies

              HTML-Basics

              Practice Tags :

              HTML

              Read Full Article

              Video liên quan

Bài mới nhất

Chủ Đề