1
My image is superimposing my text on h1
and my button
, and when I lower the screen a little, all my tag text p
superimposes the image.
I tried to use display: flex
to prevent this from happening, but it didn’t work. I tried to find some post that helps me to fix this problem, but I could not locate any.
I need the image to stay aligned to the right of my tag texts h1
and p
, and also from my button, and don’t overlap them.
Follows my code:
.container{
width: 100%;
height: 100%;
display: flex;
flex-grow: initial;
}
.content{
font-size: 16px;
margin: 5rem 4rem 0 10rem;
}
.content h1{
width: 70%;
height: 60%;
display: flex;
font-weight: 700;
color: var(--second-color);
font-size: 3.5rem;
margin-left: 8rem;
letter-spacing: 1px;
}
.content img{
margin-left: 22%;
top: 32%;
position: absolute;
}
.content p{
width: 50%;
height: 40%;
font-weight: 300;
color: var(--second-color);
font-size: 24px;
margin-left: 8rem;
position: relative;
}
.btn{
width: 30%;
font-weight: 700;
margin-left: 8rem;
padding: 1rem;
font-size: 2rem;
background: var(--main-color);
color: white;
cursor: pointer;
border-radius: 14px;
border: none;
}
<section class="container">
<div class="content">
<h1>Create amazing graphics</h1>
<img src="team-redimensionada.jpg" alt="imagem-ilustrativa">
<p>Colaborate and create beautiful graphics with your team</p>
<button class="btn">Start Now</button>
</div>
</section>
Thank you very much, it worked!
– Lucas Samuel