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
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.