I want to center text above an image in an div element.
This is what i tried:
CSS:
.container {
margin: 0 auto;
max-width: 1200;
}
.header {
width: 100%;
}
.ring {
max-width: 100%;
position: relative;
}
.flex_text {
position: absolute;
color: #B64547;
z-index: 100;
font-family: Poppins;
font-size: 30px;
text-align: center;
}
.cell img {
display: block;
}
Html:
<div class="container">
<div class="grid">
<div class="cell">
<h4 class="flex_text">Brewing, get started!</h4>
<img src="img/Kaffe_1.jpg" alt="Ring1" class="ring">
</div>
It did not work, obviously. The website is responsive, so the solution should work responsive aswell.
I looked around and tried a lot of different things but they didn't work. I don't know, but maybe there's a solution with jquery? Thanks :)