css当点击容器内的元素时,怎么绑定到容器的点击事件
css当点击容器内的元素时,如何绑定到容器的点击事件
当我点击<span>内的'本'时无法激活样式btn-today:active,点击<span>之外是可以激活的。
有什么写法可以解决这个问题?谢谢。。。。
------解决思路----------------------
应该是 .rb:active{
background: rgb(255,255,255);
}吧
------解决思路----------------------
.btn-tody>span{
pointer-events: none;
}
<div class="btn-today glow three-btn">
<span class="rb">本
<span class="rt">ben</span>
</span>
</div>
.btn-today:active{
background: rgb(255,255,255);
}
当我点击<span>内的'本'时无法激活样式btn-today:active,点击<span>之外是可以激活的。
有什么写法可以解决这个问题?谢谢。。。。
------解决思路----------------------
应该是 .rb:active{
background: rgb(255,255,255);
}吧
------解决思路----------------------
.btn-tody>span{
pointer-events: none;
}