Assuming the two div
s are contained in a div
:
http://jsfiddle.net/4p8CM/1/
#container > div {
display: none
}
#container > div:first-child {
display: block
}
#container > div:hover + div {
display: block
}
<div id="container">
<div>A</div>
<div>B</div>
</div>
The :first-child
stuff is to work around this limitation that you set:
base on the assumption that we cannot
use id for these 2 divs
If you want the second div
to stay visible when you hover over it, try this:
http://jsfiddle.net/4p8CM/3/
#container > div {
display: none
}
#container > div:first-child {
display: block
}
#container:hover > div {
display: block
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…