I have a layout, where I have a div
with an image, and a class
with a box above that image, the same size of that image, and I apply a transition
on top of this box to reveal it when I position the mouse over it, and a link in this box, very common in portfolios for example.
I would like to use% in Width and Height, but I can not, if I leave without height
, or with height: auto;
it stops working transition
.
If someone can help me, thank you in advance.
Follow the html and css code snippet:
#proclinica_projetos {
width: 960px;
left: 0%;
top: 50px;
position: absolute;
}
.box_transicao_proclinica {
background-color: rgba(0, 0, 0, 0);
width: 960px;
height: 960px;
top: 50px;
left: 0%;
position: absolute;
z-index: 3;
-webkit-transition: 0.5s;
/*propriedade para o google chrome*/
-moz-transition: 0.5s;
/*propriedade para o firefox*/
-o-transition: 0.5s;
/*propriedade para o opera*/
transition: 0.5s;
/*propriedade para IE*/
}
.box_transicao_proclinica:hover {
background-color: rgba(0, 0, 0, 1);
width: 960px;
height: 960px;
top: 50px;
left: 0%;
position: absolute;
z-index: 3;
-webkit-transition: 0.5s;
/*propriedade para o google chrome*/
-moz-transition: 0.5s;
/*propriedade para o firefox*/
-o-transition: 0.5s;
/*propriedade para o opera*/
transition: 0.5s;
/*propriedade para IE*/
}
<div id="proclinica_projetos">
<img src="imagens/home/proclinica_projetos.png" />
<div>
<a href="proclinica.html" class="box_transicao_proclinica"></a>
</div>
</div>