Jump to content

A hover / overlay title on blog masonry

Go to solution Solved by tuanphan,

Recommended Posts

Hi,

 

My client requires a semi-clear hovering overlay with white-text tile on blog masonry thumbnails.

 

For PC views ↓

Initial: show image, hide title & excerpt

Hover: show image, show title & excerpt (over image), show an overlay over image

For Mobile views ↓

Initial: show image, show title & excerpt

Hover: show image, show title & excerpt (below image), show an overlay over image

 

Page: https://cr-proto.squarespace.com/furniture

 

 

Can anyone help me on this? Thanks in advance J

Edited by Kellyx10
Link to comment
  • Replies 2
  • Views 964
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

With Desktop, use this code to Website Tools (under Not Linked) > Custom CSS

/* Blog masonry - Overlay title */
section.blog-item-summary {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
}
section.blog-image-wrapper {
    margin-bottom: 0 !important;
}
.blog-meta-section {
    display: none;
}
section.blog-item-summary * {
    color: white;
}
section.blog-image-wrapper:after {
    content: "";
    background-color: rgba(0,0,0,0.5);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}
article.hentry:hover section.blog-image-wrapper:after, article.hentry:hover section.blog-item-summary {
    opacity: 1;
    transition: all 0.3s ease;
}

With Mobile, use this CSS under

@media screen and (max-width:991px) {
article.hentry section.blog-image-wrapper:after, article.hentry section.blog-item-summary {
    opacity: 1 !important;
    transition: all 0.3s ease;
}
}

 

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

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.