Jump to content

FIX TEXT POSITION ON HOVER SIMPLE LIST

Recommended Posts

Hello! I have a simple list, and I've managed to display text on hover over any image in the list. However, I'm having trouble fixing the position of that text. I want the texts to appear only in the area of the preceding image and all of them start from the same height, but as you can see in the attached image, this is not happening. The CSS code I'm using is as follows:

 

<style>
  .user-items-list-item-container[data-section-id="yui_3_17_2_1_1713967083544_496"] img {
    content: unset !important;
}
</style>

<style>
.list-item:hover .list-item-content__description {
transition: all 1s;
opacity:1
}
.list-item:hover .list-item-media {
transition: all 1s;
opacity:0
}
.list-item-content__title {
  position:absolute;
  top: 95%;
  left: 2%;
  width: 100%;
  }
.list-item-content__description *{
   color:white!important
   margin: 20%;
   justify-content: start;
}
.list-item-content__description {
  position:absolute;
  top: 40%;
  left:50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 100%;
  border:0;
  text-align: left;
  opacity: 0;
}
ul.user-items-list-simple li {
    position: relative
}
ul.user-items-list-simple li:hover .list-item-content {
    opacity: 1;
    transition: 0.5s ease;
}
.list-item-content * { 
    max-width: 95% !important; 
}
@media only screen and(max-width:640px){
.list-item-content {
opacity:1!important
}
}  
</style>

Capturadepantalla2024-04-29095501.thumb.png.eba58d72c1f51c41c3650cb0e6b0d347.pngCapturadepantalla2024-04-29095438.thumb.png.029ef62390a996fb7f20c51939d45cd0.png

Link to comment
  • Replies 3
  • Views 358
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

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.