1. div鼠标悬停控制子控件显示与隐藏
悬停在父辈div上,子div显示
.son{ display: none; } .father:hover .son{ display: block; }
<div class="father">
SHOW
<div class="son">
oky
</div>
</div>
2.相邻div控制控件显示与隐藏(下面的隐藏和显示)
.two{ display: none; } .one:hover + .two{ display: block; } <div class="one"> oky </div> <div class="two"> show </div>