.blocklist__item { position: relative; background-color: #f5f5f5; padding: 10px; border: 1px solid #ddd; text-align: center; } .imageFit { position: relative; overflow: hidden; } .imageFit img { width: 100%; height: auto; object-fit: cover; } .imageFit__overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.3s; } .imageFit:hover .imageFit__overlay { opacity: 1; } .blocklist__item_title { font-size: 18px; font-weight: bold; color: #fff; } .blocklist__item_text { font-size: 14px; color: #fff; }