Recently i worked at site gallery, and trying to make description label in front of image. So, this is how it should look:
its html:
<li class="project-item">
<img src="images/project_example.jpg" alt="">
<div class="annotation">
<div class="annotation_head">Head</div>
<div class="annotation_footer">Footer</div>
</div>
</li>
Block with .annotation class is absolute, and .project-item is relative. But before that i used another solution which look odd to me, and i cant explain its behavior. Here it is:
I replaced position: absolute
rule with margin-top: -50px
, and change color
from black to red, for clarity.
Strange thing is, that background color displayed back from image, but it should be in front of it, why ? is there any reasonably css rule ?