小编Mig*_*uel的帖子

防止在父Div上触发Div的Hover事件?

当我.mensal将鼠标悬停在.operaDIV上时,它会触发鼠标悬停在父DIV上,这对我来说似乎不对.我只想要"突出"效果来处理孩子.operaDIV.

#operaContent {
  padding: 0 50px 0 50px;
  position: relative;
  overflow: visible;
}
#operaContent .opera {
  display: block;
  border: 1px solid #FFFFFF;
  border-bottom: 1px solid #DDDDDD;
  padding: 5px;
  margin-bottom: 10px;
  height: 120px;
  background-color: #0A8ECC;
}
#operaContent .opera:hover {
  border: 1px solid #AAAAAA;
  background-color: #DDDDDD;
  cursor: pointer;
}
.mensal {
  position: absolute;
  top: 1px;
  left: 8px;
  z-index: 3;
  display: block;
}
Run Code Online (Sandbox Code Playgroud)
<div id="operaContent">
  <div class="opera">
    <div class="mensal">
      DIV
    </div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html css hover

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

css ×1

hover ×1

html ×1