Gentlemen, I am pulling some images from the database, and when the user hover over them an opaque red color will be above them, and a title and text will be shown.
I did this by putting the image into a div, and inside that div I put another div with those 2 contents. I'm trying to make it invisible and put the hover mouse effect on it, but I only managed to do with position:absolute
and z-index
, but this way, as soon as 4 images appear and a fifth is loaded - it should go to the next line - it stays on top of the first one.
I want to leave it like this - view example How are you doing - view image
HTML
<div class="pure-g">
@foreach($eventos as $eventos)
<div class="pure-u-6-24">
<a href="">
<div class="conteudoEventoEscondido hideEvento">
<p class="tituloEventoEscondido">{{$eventos->nome}}</p>
<p class="localEventoEscondido">{{$eventos->local}}</p>
</div>
<img src="assets/images/eventos/thumbs/{{$eventos->miniatura}}" alt="{{$eventos->nome}}">
</a>
</div>
@endforeach
</div>
CSS
.pure-u-6-24 {
.marginReduzida(6px,0px);
a{
text-decoration: none;
&:hover {
.conteudoEventoEscondido {
display: block !important;
}
}
.conteudoEventoEscondido {
width: 17.25%;
height: 36.5%;
display: block;
background-color: rgba(210, 183, 134, 0.8);
background: rgba(210, 183, 134, 0.8);
color: rgba(210, 183, 134, 0.8);
.padding(30px,0,0,30px);
.tituloEventoEscondido {
font-size: 16px;
font-weight: bold;
.colorFonte(#4B392C);
.margin(0,0,8px,0);
}
.localEventoEscondido {
font-size: 12px;
font-style: italic;
.colorFonte(#4B392C);
}
z-index: 2;
position: absolute;
}
img {
@media screen and (min-width: 320px) and (max-width: 768px){
width: 100%;
}
z-index: 1;
position: absolute;
}
}
}