Archived topic
Is there a way to get shadow boxes around images in a post?
3 replies · Started by Heath on November 12, 2020
I have a shadowbox around the widgets using CSS. Is the same possible for images or is that not advisable?
Hi,
I have a shadowbox around the widgets using CSS. Is the same possible for images or is that not advisable?
Its definitely possible. but as for it being advisable? It depends on many things. There are definitely things to consider.
If your site follows a specific branding guideline, consider consulting with the designer if adding box shadow effect is applicable.
If you're just winging things and is going by feel, then its really up to you.
Personally, I think adding box shadow is fine as long as its subtle. I find it useful when I want to put emphasis on a particular section/element as it can be used to make things stand-out over certain backgrounds or group of contents. :)
Yeah its just me and I think it'd look great on some images. Is there CSS to add to make a show box appear around a particular image or is that editing that needs to be done prior to adding the image to my site library?
Hi there,
you could add some CSS like so:
.has-shadow img {
box-shadow: 0 2px 8px 2px rgba(0,0,0,0.5);
}
Then in the Block Editor select the image you want the shadow applied to, go to Settings > Advanced --> Additional CSS class(es) and add: has-shadow