Write an HTML program to create an unordered list of fruits

Description: Create a web page with a bullet list of 5 fruits.

Hint:

  • Use <ul> for the list and one <li> for each fruit.

HTML program for an unordered list

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Fruits</title>
</head>
<body>
  <h2>My favourite fruits</h2>
  <ul>
    <li>Apple</li>
    <li>Banana</li>
    <li>Mango</li>
    <li>Orange</li>
    <li>Grapes</li>
  </ul>
</body>
</html>

Output in the browser:

Output in the browser

My favourite fruits

  • Apple
  • Banana
  • Mango
  • Orange
  • Grapes

How it works

  • ul means unordered list. The browser shows bullet points.
  • Every item must be inside an li tag.
  • Add style="list-style-type: square;" to the ul to change the bullet type.

Read HTML Lists.


Learn more about the similar topics:
Tutorials
HTML Lists
HTML Tables
HTML Table Rowspan & Colspan
Exercises & Assignments
Write an HTML program to create an unordered list of fruits
Write an HTML program to create an ordered and a nested list
Write an HTML program to create a table of student marks
Write an HTML program to create a table with colspan and rowspan
Interview Questions & Answers
What are different tags to list items in HTML?
How do you create a table in HTML?
What is the use of colspan and rowspan in HTML?