← HTML + CSS

Como fazer aparecer uma div dentro de outra div com hover?

Lida 7031 vezes

Offline

alexandremdn 
Membro
Mensagens 94 Gostos 2
Feedback +2

Troféus totais: 25
Trófeus: (Ver todos)
Nineth year Anniversary Level 5 Level 4 Avatar Eighth year Anniversary Seventh year Anniversary Windows User Super Combination Combination Topic Starter

boas, neste exemplo a div "div_aparecer" aparece fora da div em baixo... eu pretendia k aparecesse dentro da div

tenho este código:

.box1 {
display:inline;
width:130px;
height:97px;
margin:5px 0 0 1px;
}

#box1 #div_aparecer {
display:none;
}

#box1:hover #div_aparecer {
display:block;
background-color:#000;
width:32px;
height:32px;
}

html:

<div class="box1" id="box1">
<a href="#"></a>
<div id="div_aparecer ">
</div>
</div>

Offline

Nuno 
Administrador
Mensagens 7780 Gostos 216
Feedback +2

Troféus totais: 42
Trófeus: (Ver todos)
100 Poll Votes Level 7 Search Mobile User Level 6 Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Código: [Seleccione]
.box1 {
display:inline;
width:130px;
height:97px;
margin:5px 0 0 1px;
position: relative;
}

#box1:hover #div_aparecer {
display:block;
background-color:#000;
width:32px;
height:32px;
position: absolute;
bottom:0px;
left:0px
}

Não uses id e classes com o mesmo nome... o display:none também não está ai a fazer nada, porque a seguir tens um block...