0
I am developing a web application and I would like that when you do not move the mouse over the image, stay on the screen only the image, without the product description, the price and the border around it.
Image without the effect of Hover.
And when I hover over the image I would like the image to be surrounded by the border and the product description, price and the Learn more button.
Image with Hover
HTML
<div class="col-sm-3 col-md-3">
<div class="linha">
<img src="imagens/camisa_1.JPG" alt="camisa1" class="imagem_teste">
<a href="#" onMouseOver="mostrarElemento('saiba_mais1', 'inline');"
onMouseOut="mostrarElemento('saiba_mais1', 'none');" >
<p class="descricao_produto">Calça Jeans Armani</p>
<h4 class="preco"> A partir de R$134,99</h4>
<button class="saiba_mais" id="saiba_mais1">SAIBA MAIS</button>
</a>
</div>
</div>
CSS
.linha{
border: 1px solid #E0E0DA;
height: 390px;
}
.descricao_produto{
color:black;
font-weight: 700;
}
.preco{
color:red;
}
JS
<script language="JavaScript">
function mostrarElemento(id, visibilidade) {
document.getElementById(id).style.display = visibilidade;
}
</script>
Dvd occurred a problem when placing the code you posted the width of the Learn button decreases further and did not occupy the maximum border width
– User1999
@User1999 My code was just an example. You must adapt in your code.
– Sam
@User1999 Strip the
padding: 10px;
.– Sam
but then pq in class . saiba_more{ background-color: #00008B; color: white; padding: 16px; font-size: 13px; border: None; width: 100%; margin-top: 20px; } I put width 100% but did not occupy the full border width
– User1999
@User1999 Because of the
padding
.. I put it as an example, you can take it.– Sam
i drew . line { border: 1px Solid #fff; height: 390px; display: inline-block; }
– User1999
but still the button did not fill the space
– User1999
@User1999 Other than that, the rest was good?
– Sam
yes DVD worked properly thank you
– User1999
@User1999 So let’s see the button throw?
– Sam
Come on, watch this thing
– User1999
@User1999 Vc must be using bootstrap neh?
– Sam
yes, I’m using
– User1999
@User1999 I needed to see a print of how it is and the HTML code of it.. is because the code of your question cannot reproduce exactly the HTML... does not have the class of this button etc
– Sam
I managed to get here rs vlw
– User1999
@User1999 Blz dude! Abs!
– Sam