HTML Element Style How to - Set Bullet Color








Question

We would like to know how to set Bullet Color.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
ul {<!--   w  ww .j ava 2s.c  o m-->
  list-style-type: square;
}

ul>li {
  color: green;
}

ul>li>span {
  color: black;
}
</style>
</head>
<body>
  <ul>
    <li><span>Text</span></li>
  </ul>
</body>
</html>

The code above is rendered as follows: