Jump to content

Add Colored Background Behind Inline Image Block

Recommended Posts

Site URL: http://www.blaynegoldwasser.com

Hello,

I am trying to add a colored background to sit behind my image.  I am just using an inline image block and want it to look more dynamic.  I've tried a few different codes but nothing seems to be working.

I want it to look something like this but instead of just half of the image, I want the background color to go all the way around the image block so the image is centered.

image.png.246c6f5c6ec29342a968560d83222d41.png

 

It is for this section of my website under "Technical Design"

 

1260324451_sitegrabexample.thumb.png.ec7bdc218e908c9f8b73f56e3f24bc03.png

 

Thanks!

Link to comment

Add to Design > Custom CSS

/* Techincal Design */
div#page-section-609c5dc1e110de06f4e1c979 .image-block-wrapper {
    overflow: visible !important;
}
div#page-section-609c5dc1e110de06f4e1c979 .image-block-wrapper:before {
    content: "";
    background: green;
    display: block;
    position: absolute;
    top: -20px;
    left: -20px;
    width: 50%;
    bottom: -20px;
    z-index: 999;
}

image.thumb.png.a74b67f11ca739ff9f2f9dc2e9ca3a40.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.