How to control the space between bullet and li with CSS?

Spread the love

Sometimes, we want to control the space between bullet and li with CSS.

In this article, we’ll look at how to control the space between bullet and li with CSS.

How to control the space between bullet and li with CSS?

To control the space between bullet and li with CSS, we can set the padding of the element before the li.

For instance, we write

li:before {
  content: "";
  margin-left: -0.5rem;
}

to select the element before the lis with li:before.

Then we set its margin-left to a negative value to reduce their margins.

Conclusion

To control the space between bullet and li with CSS, we can set the padding of the element before the li.

Leave a Reply

Your email address will not be published. Required fields are marked *