Good afternoon,
I had two queries that may be easy to solve.
I have placed a gray box at the bottom of two images to show text. Actually at the end it will be a collection of 9 images, but I wanted to see the effect on two images first (attachment capture).
My two questions are the following:
-
In both images the box slides a bit below, how could you make it stay on the edge of the image?
-
When I type more or less text, the gray box is resized. Would there be any possibility of leaving it in fixed size?
Here is the code:
<style>
.img-texto {
position: relative;
float: left;
}
.img-texto span {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
background: #848282;
padding: 60px;
color: #fff;
font-family: sans-serif;
opacity:0.8;
font-size: 20px;
}
</style>
<div class="img-texto">
<img src="img/img1.png" alt="" height="900" width="670" />
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco</span>
</div>
<div class="img-texto">
<img src="img/img2.png" alt="" height="900" width="670" />
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco</span>
</div>
Can you help me out please?