Site logo

Archived topic

Bulleted and numbered lists

5 replies · Started by Fredrik on September 30, 2019

Viewing posts 1–6 of 6

Hi,

I have two questions regarding lists:

1) How do I decrease the indent in a bulleted or numbered list (the whole paragraph)?

2) How do I increase the space between paragraphs in a bulleted or numbered list?

Hi there,

this CSS to reduce indentation:

.entry-content ul, .entry-content  ol {
    margin-left: 2em;
}

And this to increase space between list items:

.entry-content li {
    margin-bottom: 2em;
}

This will apply to any lists within your content - so it doesn't effect list markup in the theme or widget areas.

Perfect, thank you.

Is there a way to increase the size of the bullet in a bulleted list as well?

Ok, I see. Thanks for the link.

Is there an easy way to change the color of the bullets or numbers in a list?

For unordered lists you would need to do this:

.entry-content ul li {
    list-style: none;
    position: relative;
}

.entry-content ul li:before {
    content: "";
    position: absolute;
    left: -1.5em;
    top: 0.25em;
    /* Adjust according to width and height */
    width: 10px;
    /* Change size */
    height: 10px;
    /* Match width */
    background-color: red;
    /* Set color */
    border-radius: 50%;
}

Ordered lists are a little more complicated and would require this:

.entry-content ol {
    list-style: none;
    position: relative;
    counter-reset: custom-counter;
}

.entry-content ol li {
    counter-increment: custom-counter;
}

.entry-content ol li::before {
    content: counter(custom-counter);
    color: red; /* Change color */
    font-size: 18px; /* Set font size */
    line-height: 18px; /* Adjust for alignment */
    position: absolute;
    left: -1.5em;
}
This archived topic is closed to new replies.