• Hi everyone, I am trying to add a white background to some paragraph blocks on a post in the editor (Block > Colour > Background Colour).

    This seems to automatically create a margin on all four sides of the block of text. This makes the text look too compacted for my liking. (NB. The paragraph block itself isn’t changing width.)

    Is there a way to make the text extend to the edges of a paragraph block that has a background colour?

    Thanks for reading!

    (The post isn’t ready to be published yet or I’d link to it. I hope my description of the problem is clear enough)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    You can add this CSS in the Customizer:

    p.has-background {
    	padding: 1.25em 0;
    }

    The first value is the spacing above and below the text, and the second is the spacing to the sides – if you want to remove the spacing above and below as well, just use a single value of 0.

    I notice this CSS doesn’t work for me in the Customizer preview when I add it, but it does work on the site itself after I save it.

    Thread Starter sojsz

    (@sojsz)

    Thank you so much! That worked perfectly.

    Glad I could help ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Paragraph width changes when I add background colour’ is closed to new replies.