Jump to content

Can I create a hover effect over a background image?

Recommended Posts

Site URL: https://alligator-buffalo-slhk.squarespace.com/projects-1

Hi, Does anyone know if i can create a hover effect on a background image using CSS ?  (as opposed to an image block). I want to create a white overlay on all backgrounds on this page,  

https://alligator-buffalo-slhk.squarespace.com/projects-1

... and only reveal full colour of image on hover.

(We are using full bleed backgrounds, rather than image blocks, to achieve a transparency on the header)

-Andrew

Link to comment
  • Replies 4
  • Views 933
  • Created
  • Last Reply
16 hours ago, andrewmel said:

ok, that's done @tuanphan  password is assist

Add to Page Settings > Advanced > Header

<style>
  #page section .section-background:after {
    background: rgba(255,255,255,0.75);
    content: "";
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
}
  #page section:hover .section-background:after {
    opacity: 0;
}
</style>

 

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

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.