How do I put a h3
tag and a p
in the same image, however I want to put the p
tag down as a footer
and h3
on the top of the image when hovering the mouse on image hover
brings the two tags together.
CSS:
position:relative;
height:170px;
width:100%;
margin: -90px 100px 110px -0px;
border:5px solid #E6E6FA;
box-shadow:4px 4px 8px black;
}
#hColunas{
font-family:"Lucida Console";
font-size:20px;
position:absolute;
top:0px;
background-color:rgba(0,0,0,.4);
color:#fff;
width:100%;
height:170px;
top:-20px;
opacity:0;
}
#hColunas:hover{
opacity:1;
}
#pColunas{
font-family:"Lucida Console";
font-size:15px;
position:absolute;
top:120px;
background-color:rgba(0,0,0,.4);
width:100%;
opacity:0;
}
#hColunas:p{
top:120px;
}
#pColunas:hover{
opacity:1;
}
HTML:
<div class="alimages">
<div class="colunasDeImages">
<a href="http://www.itapemapark.com.br/" target="_blank"><img src="backgrounds/nyaqua1.jpg" width="220px" height="170px"></a>
<h3 id="hColunas">Confira nossas instalações</h3>
<p id="pColunas">Uma nova maneira de curtir o verão</p>
</div>
<div class="colunasDeImages">
<a href="https://www.google.com/" target="_blank"><img src="backgrounds/nyaqua2.jpg" width="220px" height="170px"></a>
<h3 id="hColunas">Confira nossas trilhas e passeios</h3>
<p id="pColunas">Uma nova maneira de curtir o verão</p>
</div>
<div class="colunasDeImages">
<a href="#" target="_blank"><img src="backgrounds/nyaqua3.jpg" width="220px" height="170px"></a>
<h3 id="hColunas">Confira nosso local para refeições</h3>
<p id="pColunas">Uma nova maneira de curtir o verão</p>
</div>
</div>