3
I have a layout, where I have a div
with an image, and a class
with a box over that image, the same size as that image, and I apply a transition
on top of this box to reveal it when positioning 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’m not succeeding, if I leave without the height
, or with the height: auto;
it stops working the transition
.
If anyone can help me, I’d appreciate it.
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>
I tried to format your code
html
andcss
, in the snippet executable here from the OS, but not as you described, follow it and try to make adjustments, to make it similar to your environment, so that we can better understand your problem and possibly help you. Welcome to the Sopt.– Fernando Leal
blza, I’m gonna run some tests and if I don’t make it back with that change.
– Juliocesar