I was looking for an answer, but can't find one that works for me.
How do I get the text "HEY YOU" on top of the image?
HTML:
<div class="row gallery_container">
<div class="sort_item study">
<a><img src="images/city_1.jpg" class="gallery_project" style="width: 200px; height:200px;"/>
<div class="gallery_text">
<h2>HEY</h2>
<span>YOU</span>
</div>
</a>
</div>
</div>
CSS:
.gallery_container {
width: 850px;
display: block;
margin: 0 auto;
box-sizing: border-box;
}
.sort_item {
box-sizing: border-box;
float: left;
padding: 4px;
width: 25%;
}
I tried position:relativeon .gallery_projectand position:absoluteon .gallery_text.
Also tried to make a container and .sort_item position:relative(not at the same time)
source
share