Hello dear developers,
I want to blur the background image on hovering.but it does not work. Can anybody help me? i tried many ways. This is a box and i wand to blur backgournd and show the text with hover-over-effect. currently when the mouse is over the boxes, the following happens: Either: the Background becomes blur but the text does not appear or: The texts appear but background will not blur
HTML
<div class="kursContainer">
<div class="BodyKurs">
<h1>Body</h1>
<picture>
<img src="../Kurse/img/body.webp" alt="zumba">
</picture>
<div class="overlay">
<h2>Body</h2>
<h3>Abnehmen - 6 Wochen</h3>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
</div>
</div>
CSS
.kursContainer {
display: grid;
justify-content: space-evenly;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1em;
justify-items: center;
width: 122vmin;
margin: 2vmin auto;
align-items: center;
grid-template-areas:
"body body fatburn"
"body body zumba"
"yoga sixpack sixpack"
"step sixpack sixpack"
"backwork backwork tourde"
"backwork backwork booty";
}
.BodyKurs{
position: relative;
width: 80vmin;
height: 80vmin;
border-radius: 10px;
background-color: var(--schwarz);
transition: transform 0.2s;
}
.BodyKurs img{
width: 80vmin;
border-radius: 10px;
}
.BodyKurs h1 {
position: absolute;
text-align: start;
padding-left: 3vmin;
bottom: 1vmin;
color: var(--hellGrau);
font-size: 8vmin;
}
.BodyKurs:hover {
box-shadow: 0 0px 4.6px rgba(0, 0, 0, 0.278),
0 0px 15.4px rgba(0, 0, 0, 0.411), 0 0px 69px rgba(0, 0, 0, 0.69);
transform: scale(1.05);
z-index: 2;
cursor: pointer;
}
.overlay {
width: 80vmin;
height: 80vmin;
position: absolute;
text-align: center;
bottom: 0;
border-radius: 10px;
color: var(--hellGrau);
transition: 0.3s all;
/* background: rgba(0, 0, 0, 0.2); */
visibility: hidden;
cursor: pointer;
z-index: 5;
}
.overlay:hover {
visibility: visible;
}
picture:hover {
filter: blur(5px);
}