Site logo

Archived topic

Adding Margins to Images Inside Blog Posts

3 replies · Started by Christian on September 21, 2020

Viewing posts 1–4 of 4

Hey, Team!

How could I increase the top and bottom margins for images added to blog posts.

Like images added with Gutenberg's Image block, not Featured Images.

I'd also like to add this margin only to the images inside blog posts, not the homepage or other any other pages. :)

Hi Christian,

You can do that with custom CSS.

body.single figure.wp-block-image img{
	margin-top:50px;
	margin-bottom:50px;
}

This will only apply to Gutenberg image blocks placed on posts.

Gotcha!

Thanks, Elvin. You're cooler than Perry the platypus! :)

lol. how I wish I could life a cool life of a spy.

No problem.:)

This archived topic is closed to new replies.