Jump to content

Add transparent black overlay to blog post banner image

Go to solution Solved by Ziggy,

Recommended Posts

Hello!

Wandering if anyone could help me add a 30% black overlay to the blog post banner image. I'm using Will Myers code (https://www.will-myers.com/articles/blog-post-banner-image-update) to display the featured blog image as a banner on the post page itself, but need to add an overlay onto the banner image on the blog post page to make the white title on top more legible.

Looking for the code that can do this and to know if it should be added to the "Post Blog Item Code Injection" section which currently has:

<div data-wm-plugin="blog-post"></div>
<style>
.wm-blog-banner {
   min-height: 20vh !important;
}
</style>

Appreciate any help, thanks

Ricky

 

Link to comment

Link to the site please?

Work With Me 🖥️💻📱

Please remember to tag me so that I get a notification and respond to your help requests.

If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly.

You can also thank me or make requests by buying me a coffee . (Caffeine fuels me to take more requests)

For Squarespace Tips & Tricks, visit @squareskills (Youtube 📺 Tutorials)

For Premium and FREE plugins, visit Squareskills (Plugin Store) 🧩

Some links may be affiliate/referral links.

Link to comment
  • Solution

Add this to Custom CSS or within the style tags you currently have:

body:not(.sqs-edit-mode-active) {
  .wm-blog-banner:after,
  .sqs-block-image .image-block-wrapper:after {
    background:rgba(0,0,0,0.3);
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
  }
}

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment
On 12/16/2023 at 2:58 PM, Ziggy said:

Add this to Custom CSS or within the style tags you currently have:

body:not(.sqs-edit-mode-active) {
  .wm-blog-banner:after,
  .sqs-block-image .image-block-wrapper:after {
    background:rgba(0,0,0,0.3);
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
  }
}

 

That worked perfectly! Much appreciated 🙂

Link to comment
5 minutes ago, Rickshaw said:

That worked perfectly! Much appreciated 🙂

Glad to be a help!

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment

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.