Jump to content

Code for caption overlay

Recommended Posts

Site URL: http://www.polymerventures.com/home-1

I would like to do the following with the caption overlays - site wide.

  • keep the background white
  • move captions to the top of the image blocks
  • make the text black 
  • decrease the padding 

I found all of the details in the inspector but I can't figure out the code to change them. 

Current code used:
/* Image Captions on Hover*/
.image-caption-wrapper {
min-height: 5%x;
display: flex;
justify-content: center; /*text align center*/
background: white!important; /* Background Overlay*/
}

Screen Shot 2021-01-13 at 7.35.30 AM.png

Link to comment
  • Replies 2
  • Views 901
  • Created
  • Last Reply
1 hour ago, abbydowning said:

I would like to do the following with the caption overlays - site wide.

  • keep the background white
  • move captions to the top of the image blocks
  • make the text black 
  • decrease the padding 

 

You can do this with the following CSS, added to Design > Custom CSS. The padding is shown as the current value (18px). You can adjust this to reduce the padding around the titles.

 

/* Captions on top, reduce padding */
.sqs-block-image .image-block-outer-wrapper.layout-caption-overlay .image-caption-wrapper, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay-hover .image-caption-wrapper {
    top:0; bottom: auto;
    padding: 18px;
}
/* Black captions */
.sqs-block-image .image-block-outer-wrapper.layout-caption-overlay .image-caption-wrapper h1, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay-hover .image-caption-wrapper h1, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay .image-caption-wrapper h2, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay-hover .image-caption-wrapper h2, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay .image-caption-wrapper h3, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay-hover .image-caption-wrapper h3, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay .image-caption-wrapper strong, .sqs-block-image .image-block-outer-wrapper.layout-caption-overlay-hover .image-caption-wrapper strong {
    color: #000;
}

 

7WmyBG9JTM.thumb.gif.96ba39f5680aaff4248b594295d789ae.gif
Effect of CSS when applied

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.