I am trying to create a zoom effect on the background-image with an animation but I am encountering issues where all child elements are also animated and zoomed. When hovering over the element, I want only the background part to be animated and zoomed, and I suspect it might have to do with the html structure.
CSS
.laboratorio_container
{
padding: 2em;
}
.fondo_laboratorio{
color: white;
background-image: url(/img/laboratorios/lab1.jpeg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 18em;
display: flex;
align-items: center;
}
.fondo_laboratorio:hover{
transition: all .5s;
transform: scale(120%);
-webkit-transform: scale(120%);
-moz-transform: scale(120%);
-ms-transform: scale(120%);
-o-transform: scale(120%);
-webkit-transition: all .5s;
-moz-transition: all .5s;
-ms-transition: all .5s;
-o-transition: all .5s;
}
.laboratorio_container
{
background-color:rgb(0,0,0,.5);
}
HTML
<div class="container">
<div class="row fondo_laboratorio">
<div class="col laboratorio_container">
<div class="row ms-2">
<h1 class="p-0">Laboratorios</h1>
</div>
<div class="row mb-3 ms-2">
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Impedit, quo explicabo beatae aspernatur debitis ut, quod asperiores necessitatibus tempora quam
deserunt magni facilis maxime molestias nihil laudantium exercitationem quae quaerat?
</div>
<div class="row ms-2 w-25">
<button class="btn btn-light">Reservar <svg width="16" height="16" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill="#000" d="M459.15 269.75a133.197 133.197 0 0 1-55.862 179.975l-42.782 22.541-10.52 5.533a71.277 71.277 0 0 1-62.966 1.685l-167.077-71.38 15.733-46.676 99.363 19.194-51.458-97.78-82.843-157.411 40.357-21.232 82.844 157.457 19.934-10.485-36.521-69.445 40.335-21.22 36.52 69.445 19.935-10.485-28.2-53.598 40.358-21.232 28.2 53.598 19.945-10.576-19.354-36.886 40.346-21.174 19.354 36.885 54.348 103.301zM73.268 146.674a60.03 60.03 0 0 1 42.361-102.459 60.098 60.098 0 0 1 56.58 80.169l...
</svg>
</button>
</div>
</div>
</div>
</div>