HTML unordered list tag


Definition of HTML <ul> tag

HTML <ul> tag is used to show information in the form of a list. This display list with no special order. We can call this list as a bulleted list.


The table of content showing the list of headings I am using to explain HTML unordered list tag.


Syntax

It includes HTML list tag to show listings. There can be multiple <li> tags in the <ul> tag.

If you want to show information in the form of lists and want to use the numbers at the start in each list item. You can use <ul>. We can call this list as Numbered list.

Output

List of Games:

  • Football
  • Cricket
  • Table Tennis
  • Badminton
  • Basketball
  • Baseball

Multiple unordered list(<ul> inside <ul>)

You can use multiple <ul> inside the unordered list. To use multiple unordered list, use <ul> tag inside <li> tag. To explain this, see the example below:

Output

List of Games:

  • Indoor Games
    • Chess
    • Ludo
    • Video games
  • Outdoor Games
    • Cricket
    • Badminton
    • Football

This contains the multiple stage unordered lists. First list contains the list of Indoor games chess, Ludo and video games. The second list contains the list of outdoor games.


List of type attribute options

Show different list styles using the type attribute.

Sr. No. Type Attribute options Description
1 square Used to show square shape bulleted unordered list.
2 disc Used to show disc shape bulleted unordered list.
3 circle Used to show circle shape bulleted unordered list.

Unordered list with type=”square”

It is used to show the square shape bulleted HTML unordered list. The list contains the dots which are square in shape.

Output

List of Countries:

  • United States
  • China
  • united Kingdom
  • Australia

This contains the list of countries. You can also list out the square shaped list with the CSS list style property. Specify the value as ‘square’. This converts the bullets to square shape.


unordered List with type=”disc”

It is used to show disc shape bulleted unordered list. The dots are also applicable to the internal lists.

Output

List of Fruits:

  • Apple
  • Banana
  • Grapes
  • Orange

unordered List with type=”circle”

It is used to show circle shape bulleted list.

Output

List of Movies:

  • Resident Evil
  • Titanic
  • Jurassic Park
  • Beauty and the Beast

Resources and References

1. W3C Specification.
2. HTML living standard
3. W3C project using Github