I would like to place a title over a SVG image and center them in a bootstrap 5 row.
The "Team" title is positioned centered over the image but when I resize the browser or on mobile screen the title and sub-title resize accordingly but the image is not resized and stay in the original size.
I tried several solutions but I cannot have it to work. Can some help me? Thanks.
.title-with-cloud {
position: relative;
text-align: center;
}
.title-with-cloud img {
width: 10vw; /* added by community */
}
.team-title {
font-size: 5vw;
font-weight: bold;
position: absolute;
bottom: 24px;
margin-left: 50%;
margin-right: -50%;
transform: translate(-50%, 0%);
}
.team-subtitle {
font-size: 2vw;
font-weight: 400;
margin-bottom: 2.5em;
}
<div class="row">
<div class="col-12 text-center">
<div class="title-with-cloud">
<img class="img-fluid" src="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/caution.svg"></img>
<h1 class="team-title">Team</h1>
</div>
<p class="team-subtitle">Some text...............</p>
</div>
</div>