I have a banner div element with an image overlapping it. I'm trying to display my text without it being covered by the image, but I'm facing some challenges.
Here's a visual example of the issue:
https://i.stack.imgur.com/JdW75.png
This is what my HTML code looks like:
.header-banner-container {
background: #221E1F;
position: relative;
width: 100%;
height: 11vh;
top: 38px;
z-index: -1;
}
.header-logo {
position: absolute;
padding-left: 3px;
height: 89px;
width: 92px;
}
.banner-text {
font-family: 'Roboto', sans-serif;
font-size: 11px;
color: white;
position: relative;
top: 50%;
transform: translateY(-50%);
}
<img class="header-logo img" src="../../../assets/CatPicture.png">
<div class="container-fluid header-banner-container">
<span class="banner-text">There is a cat above me</span>
</div>
My queries are:
Is it recommended to place the image within the container-fluid div for better practice? Or is having it outside the banner as I currently do acceptable?
How can I ensure that the text isn't hidden behind the image?
Thank you for any guidance on these questions and other suggestions you may have!