List Style

Exercise

  1. In the "index.html" file, replace the code with the following:
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS</title>
  <link rel="stylesheet" href="./css/styles.css">
</head>

<body>
  <h1>List Style</h1>
  <ul>
    <li><a href="#">Default List Style</a></li>
    <li id="no-list-style"><a href="#">No List Style</a></li>
    <li id="disc-style"><a href="#">Prices</a></li>
    <li id="circle-style"><a href="#">Contact</a></li>
  </ul>
</body>

</html>
  1. Save.
  2. If "Live Server" is not already running, right-click anywhere in the editor and select "Open with Live Server" from the context menu.
  3. In the "styles.css" file, replace the code with the following:
#no-list-style {
  list-style: none;
}

#disc-style {
  list-style: disc;
}

#circle-style {
  list-style: circle;
}
  1. Save.
  2. In the browser, you should see the following:

  3. Exercise 2 Result

Code Walkthrough and Explanation


list-style

In CSS, the list-style property is used to control the appearance of the markers (or bullets) that appear alongside an unordered list (<ul>) or an ordered list (<ol>).

The list-style property has three sub-properties:


Experiment with the Code


Video and Code References


Questions? Subscribe and ask in the video comments:


GitHub and Other References