So I created two divs within each other and my idea was this: I wanted to leave an inactive div, and when I left the mouse on one, the other one appears.
The command I used for this is opacity: 0; to make it invisible and when I left the mouse on top put the command opacity: 1; for it to appear. Only I wanted it only when the mouse is passed over the div #botao it appears. Can I do this by css?
the code is this:
#botao {
position: relative;
float: left;
height: 20px;
width: 20px;
background-image: url(../img/wats.jpg);
margin-top: 7px;
margin-left: 4px;
transition: all 0.5s ease;
}
a.botao-link {
display: block;
height: 100%;
width: 100%;
text-decoration: none;
}
#botao:hover {
background-image: url(../img/wats-hover.jpg);
transition: all 0.1s ease;
}
#comentario {
text-align: center;
position: relative;
top: -22px;
left: 30px;
padding: 2px;
line-height: 20px;
background: #333;
color: #fff;
display: block;
width: 120px;
opacity: 0;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
}
#botao:hover #comentario {
opacity: 1;
<div id="botao"><a href="#" class="wats-link"> botao </a>
<div id="comentario">Comentário</div>