CSS Property Value How to - list-style-type: square;








Question

We would like to know how to list-style-type: square;.

Answer


<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of setting list styles</title>
<style type="text/css">
ul {<!-- w w  w. j  ava 2  s.  c o m-->
  list-style-type: square;
}

ol {
  list-style-type: upper-roman;
}
</style>
</head>
<body>
  <h1>Setting style of bullet point</h1>
  <h2>Unordered List</h2>
  <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ul>
  <h2>Ordered List</h2>
  <ol>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ol>
</body>
</html>

The code above is rendered as follows: