Site logo

Archived topic

Is there a way to get a shadow box around photos in posts?

7 replies · Started by Heath on May 31, 2021

Viewing posts 1–8 of 8

I want to have some shadow boxes around some photos in blog posts. Not featured images but I'd like to have the option of putting shadow boxes around screeshots and other images in blog posts. How would I go about that?

Here is about what I'm looking for. https://ibb.co/d4K2675

Hi there,

you would need some CSS. In the block editor, select the Image Block, in the sidebar settings Advanced > Additional CSS Class(es) add the custom css class eg. image-shadow

Then you can add the following CSS to your site:

.image-shadow img {
    box-shadow: 0 2px 4px 6px rbga(0,0,0,0.1);
}

Then simply add the image-shadow additional CSS Class to the images you want it applied to.

This site here will generate the box-shadow style for you:

https://cssgenerator.org/box-shadow-css-generator.html

I appreciate the steps. I've done all of these but nothing is showing up on the image.

Hi Heath,

Can you link us to one of these images that you've applied the steps?

Thanks!

Are we talking about an image or a post with an image in it?

A post with an image I guess :)

I out the link in the private information field. It is not not featured image but the 2nd image.

Try this CSS instead:

.image-shadow img {
    box-shadow: 0 2px 4px 6px rgb(0 0 0 / 10%);
}

Let me know :)

This archived topic is closed to new replies.