Bulleted list HTML

Prev

Next

Types of HTML Lists

  • (ol)- Ordered List
  • (ul)- Unordered List(Bulleted list)
  • (dl)- Description List

HTML List Tags Examples

Ordered List /Numbered List (ol)​

The

    tag is used to create an ordered list and
  1. tag starts the list of items. It is also called as a numbered list because list items are marked with numbers.

    Bulleted list HTML

Example

  1. January
  2. February
  3. March
  4. April
  5. May
  6. June
  7. July
  8. August
  9. September
  10. October
  11. November
  12. December

Run the Code

Different list styles in ordered list

Apart from the normal list style, there are other styles as well. The default list will always start from 1.

Suppose, you want to create an ordered list which should not start from 1, then you have to exclusively set the particular ordered list type.

The Syntax of different list types:
type=value
where, value can be a number or alphabet

The important ordered list types are

  1. type=1 To start the ordered list like 1,2,3 etc.
  2. start=4 It will create an ordered list starting from 4. Example 4, 5, 6 etc
  3. type=a ordered list will start from a in alphabetical order like a, b, c etc
  4. type=A ordered list will start from A in alphabetical order like A, B, C etc
  5. type=I This will create ordered list in Roman alphabet in capitals.
  6. type=i This will create ordered list in Roman alphabet in small letters.

Note/Warning/Info/Success To start ordered list from 4, the syntax is start:4. Similarly, to start from 6, the syntax will be start:6.

HTML5 does not support the type attribute so it is better to use CSS.
× Dismiss alert

Example of different list types in ordered list

<ol type="1"> <li>Mondayli> <li>Tuesdayli> <li>Wednesdayli> ol> <ol type="a"> <li>Januaryli> <li>Februaryli> <li>Marchli> ol> <ol type="A"> <li>Aprilli> <li>Mayli> <li>Juneli> ol> <ol type="I"> <li>Julyli> <li>Augustli> <li>Septemberli> ol> <ol type="i"> <li>Octoberli> <li>Novemberli> <li>Decemberli> ol> <ol start="4"> <li>HTMLli> <li>CSSli> <li>JavaScriptli> ol>

Run the Code

Unordered List /Bulleted List (ul)

In HTML Lists,

    tag list starts with unordered list and list item starts with
  • tag. It is also called as a bulleted list because list items are marked with bullets.

    Bulleted list HTML

Example

  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December

Run the Code

Follow @tutorial_brain

Different bullets styles in unordered list

Apart from the normal bullet style, there are other styles for unordered list as well like disc, square, circle etc.

Example of different bullets in unordered list

style="list-style-type:square">

  • January
  • February
  • March
  • style="list-style-type:circle">
  • April
  • May
  • June
  • style="list-style-type:disc">
  • July
  • August
  • September
  • style="list-style-type:none">
  • October
  • November
  • December
  • Run the Code

    Note/Info:

    • The list-style-type:none is mostly used for creating Navigation bars.
    • For unordered list, you can use any of the 2 syntaxs like
    1. ul style=list-style-type:square> or

      Description List /Definition List (dl)

      HTML and XHTML supports Description list.

      It defines the start of description list.
      This tag defines term in description list.
      This tag describes Term description in definition list.

      Bulleted list HTML

      Example

      AIR
      All India Radio (Broadcasting)
      CDMA
      Code Division Multiple Access
      DVD
      Digital Versatile Disk
      FAO
      Food and Agriculture Organisation

      Run the Code

      Interview Questions & Answer

      1. Explain list elements in HTML?

      Ordered list It displays the elements in numbered format. It is represented by

        tag.

        Unordered list It displays the elements in bullet format. It is represented by

          tag.

          Definition list It displays elements in definition form like in dictionary. The

          ,
          and
          tags are used to define description list.

          It defines the start of description list..

          This tag defines term in description list.

          Describes Term description in definition list.

          1. How do you change the number type in the middle of a list?

          The tag includes two attributes type and value. The type attribute can be used to change the numbering type for any list item. The value attribute can change the number index.
          For example,

          DOCTYPE html> <html> <head> <body> <ol> <li>Appleli> <li type="i" >Mangoli> <li>Bananali> ol> body> html>

          output:-
          1. Apple
          ii. Mango
          3. Banana

          1. How can you make a bulleted list in HTML?

          Here is code to make a bulleted list in HTML.

          DOCTYPE html> <html> <head> <body> <ul> <li>Appleli> <li>Mangoli> <li>Bananali> <li>Coconutli> ul> body> html>

          1. Write an HTML code that outputs the following:-

          Output

          Fruits

            1. Apple
            2. Mango
            3. Banana

          Flowers

            • Rose
            • Lilly
            • marigold

          DOCTYPE html> <html> <head> <body> <dl> <ol> <dt><b>Fruitsb>dt> <dd><li>Appleli>dd> <dd><li>Mangoli>dt> <dd><li>Bananali><dt> ol> <dl> <ul> <dt><b>Flowersb>dt> <dd><li>Roseli>dd> <dd><li>Lillyli>dd> <dd><li>marigoldli>dd> ul> dl> body> html>

          1. Can we change the color of bullets?

          By default, it is not possible to change the color of bullets. But, we can do it with CSS and HTML by using ::before selector.
          For Example,

          DOCTYPE html> <html> <head> <style> ul { list-style: none; } ul li::before { content: "\2022"; /* Add content: \2022 is the CSS Code/unicode for a bullet */ color: blue; font-weight: bold; display: inline-block; width: 2em; margin-left: -2em; } style> head> <body> <ul> <li>Appleli> <li>Mangoli> <li>Bananali> <li>Coconutli> ul> body> html>

      Prev

      Next

      Facebook Twitter Google-plus