Where do the bullets come from on elements?

The bullets are contained “within” the padding of <ul> element:

The padding is marked green and the margin orange:

1

Decreasing the padding shows that the bullets are “within” that padding:

4

Increasing the margin of the <ul> for example, shifts it right.

2

The list-style property controls the bullets themselves. Setting it to none will hide them. You would need to set the margin and padding to 0 if you want to get rid of the indent too.

ul
{
    list-style: none;
}

3

If you want to get rid of all margins / paddings and the bullet points, use this:

ul
{
    list-style: none;
    margin: 0;
    padding: 0;
}

5


Of course, you can also apply bullets to other HTML controls:

div
{
    padding-left: 40px;
}
a
{
    display: list-item;
    list-style: disc;
}
<div>
    <a href="#">Item #1</a>
    <a href="#">Item #2</a>
    <a href="#">Item #3</a>
    <a href="#">Item #4</a>
</div>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)