Given an unordered lists (UL) of bullets, we need to change the color of the bullets in the list using CSS.
Note: It is not allowed to use any images or span tags.
First of all, there is not direct way in CSS by which we can change the color of the bullets in an unordered list. However, to change the color of the bullets in an unordered list using CSS, we will have to first discard the default list-style and manually define the content that comes before each list item of the list.
This content is the Unicode of the kind of bullet that you want to use for your list. The Unicode characters for different bullet styles are as follows:
Below is a sample CSS code that removes the default style from an Unordered List in HTML and use unicodes:
Below programs illustrate the above approach of changing colours of list item bullets:
- HTML | Lists
- CSS | Colors
- Bootstrap 4 | Colors
- Colors and gradients in bootstrap with examples
- CSS | LISTS
- Scala Lists
- ReactJS | Lists
- Create pandas dataframe from lists using zip
- Multi-dimensional lists in Python
- Creating a Pandas Series from Lists
- Create pandas dataframe from lists using dictionary
- Python | Create a Pandas Dataframe from a dict of equal length lists
- HTML Course | Structure of an HTML Document
- HTML | DOM HTML Object
- HTML Course | Basics of HTML
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Archana choudhary