Home >Web Front-end >HTML Tutorial >css How to bind to the click event of the container when an element within the container is clicked_html/css_WEB-ITnose

css How to bind to the click event of the container when an element within the container is clicked_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:57:35915browse

<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);}

When I click 'this' inside 45a2772a6b6107b401db3c9b82c049c2, the style btn-today:active cannot be activated. Clicking outside 45a2772a6b6107b401db3c9b82c049c2 can activate it.
Is there any way to solve this problem? Thanks. . . .


Reply to discussion (solution)

should be .rb:active{
background: rgb(255,255,255);
}

.btn-tody>span{
pointer-events: none;
}

.btn-tody>span{
pointer-events : none;
}


Can pointer-events ignore upper-level events or ignore and activate lower-level events? I tried it and there was no change.
I want the background of the container to change color. On the same page, IE has this problem, but FF and Chrome have no problem
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn