Jump to content

[Share] Text Overlay on Blog Grid

Recommended Posts

Suppose you want to make text + overlay appear when users hover on a blog image on the Blog Basic Grid Page. You can follow these.

#1. Text overlay on All Blog Pages

Use this code to Custom CSS box.

/* Blog grid hover */
@media screen and (min-width:992px) {
.blog-basic-grid--text {
    position: absolute;
    top: 50%;
    left: 50%;
    text-align: center;
    transform: translate(-50%,-50%);
    opacity: 0;
    transition: all 0.3s;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column !important;
}
article.blog-basic-grid--container.entry.blog-item.is-loaded {
    position: relative !important;
    transform: unset !important;
}
.blog-basic-grid article:hover .blog-basic-grid--text {
    opacity: 1;
    transition: all 0.3s;
}
.blog-basic-grid .image-wrapper:after {
    content: "";
    background-color: rgba(0,0,0,0.75);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}
.blog-basic-grid article:hover .image-wrapper:after {
    opacity: 1;
}
a.blog-more-link {
    align-self: center !important;
}}

image.png.39406e91a90562161b150c0ab7a95dd2.png

#2. Text overlay on Specific Blog Page

If you want to do this on a specific blog page. First, you can find Blog Page ID. Use below tool.

In my example, we will have: #collection-6677756d03a4f15ba27ce9d8

image.png.399de088e62ab8ffe7decb972ee5e3e0.png

Next, use CSS code

/* Blog grid hover */
@media screen and (min-width:992px) {
#collection-6677756d03a4f15ba27ce9d8 {
.blog-basic-grid--text {
    position: absolute;
    top: 50%;
    left: 50%;
    text-align: center;
    transform: translate(-50%,-50%);
    opacity: 0;
    transition: all 0.3s;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column !important;
}
article.blog-basic-grid--container.entry.blog-item.is-loaded {
    position: relative !important;
    transform: unset !important;
}
.blog-basic-grid article:hover .blog-basic-grid--text {
    opacity: 1;
    transition: all 0.3s;
}
.blog-basic-grid .image-wrapper:after {
    content: "";
    background-color: rgba(0,0,0,0.75);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}
.blog-basic-grid article:hover .image-wrapper:after {
    opacity: 1;
}
a.blog-more-link {
    align-self: center !important;
}}}

image.png.24a2484c15cdcf0a185bd46b74405f69.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
  • Replies 0
  • Views 659
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.