Site logo

Archived topic

Changing background color for List Block

12 replies · Started by Vikram on February 3, 2020

Viewing posts 1–13 of 13

Hi

I have stumbled upon a new issue. I have a post made of blocks. The list block is not allowing me change the background color like the paragraph block. Can you please help me with that.

Regards
Vikram

Edited my answer above so make sure you see it.

Hi Leo,

The the additional css will be helpful. So that i can just change the number code to a color and keep it in the blocks I want.

Regards
Vikram

Do you want all the lists to be the same color or different colors?

Hi Leo,

I think I was not clear in explaining. I want specific portion in my post to have a different color. Now those parts ( blocks) which are paragraphs are allowing a change in background color but the on which are list are not allowing. Attached is the test image of what I would like to do.

https://www.allabouthomes.in/temp/

Regards
Vikram

Hi there,

try adding a Group Block first, this allows you to add a colored background. Then add your list inside the Group

Hi David,

It has solved my issue, however if you check the below page, you will see some extra area towards the top and bottom of the list which is having background color. Is there a way to reduce the height of the area.

https://www.allabouthomes.in/bestwashingmachine/

Vikram

Try this CSS:

.wp-block-group__inner-container {
    padding: 10px;
}

Hi Leo,

After adding the CSS, It is gone from the top, but still there at the bottom. Also there is no gap between the group block and the next paragraph.

Regards
Vikram

Add this as well:

.wp-block-group__inner-container ul {
    margin-bottom: 0;
}
.wp-block-group.has-background {
    margin-bottom: 1em;
}

Hi Leo,

Thank you very much you are an expert.

Regards
Vikram

No problem :)

This archived topic is closed to new replies.