I want to place an image in the center of my white page and add a title over it (the title would be larger than the image || also the title center must be the image center). The problem is that the title won't go on top of the image.
I use Django and bootstrap ^^
Here is the code :
HTML :
<div class="col-md-7 white nopadding text-center">
<div class="brand">
Brand
</div>
<div class="heading">
<img src="{% static '/eyemeet/hero.jpg' %}" class="hero">
<div class="title ctr">Title</div>
</div>
CSS:
.hero {
width: 65%;
height: auto;
}
.title {
position: absolute;
background-color: cadetblue;
top: 50%;
left: 50%;
}
.ctr {
position: absolute;
transform: translate(-50%, -50%);
}
EDIT :
I found the answer !! I hope it can help the ones who still wonder how to do it :) Center text over an image in flexbox