How to change bullet color in HTML
In this article, we will try to change the unordered list bullet color using the css.
Example : change bullet color using CSS. #
<style>
ul {
list-style: none;
padding: 0;
margin: 0;
}
li::before {
content: "• ";
color: red;
}
</style>
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
<li>Yellow</li>
</ul>
Try it Yourself »
- In the above example, We hide the default list style of the <ul> element using the css list-style property and set its value to none.
By default, all browsers set some padding to the unordered list so we have changed the padding to 0 of the <ul> element.
- Using the css pseudo class :before, we add a dot icon and set its color to red.
save
listen
AI Answer
How to change bullet color in HTML
0
In this article, we will try to change the unordered list bullet color using the css. Exam…
asked
Apu
0 answers
2915
In this article, we will try to change the unordered list bullet color using the css. Exam…
Answer Link
answered
Apu