上下文:可聚焦元素内的绝对元素.
在Firefox 36中,如果可聚焦元素没有CSS位置(相对,固定或绝对),则单击内部元素将不会将焦点设置为可聚焦元素...
不知道那是不是已知的bug?
在IE11和Chrome上无法再现.
为了更好地理解这个问题,这里有一个例子:
/* this is just so that the squares are similarly displayed */
section {
position: relative;
display: inline-block;
margin-right: 75px;
}
div {
background-color: red;
width: 100px;
height: 100px;
color: white;
padding: 5px;
}
div:focus {
background-color: green;
}
div > span {
position: absolute;
display: inline-block;
top: 50px;
left: 50px;
background-color: blue;
width: 100px;
height: 100px;
padding: 5px;
}Run Code Online (Sandbox Code Playgroud)
Context: an absolute element inside a focusable element.<br>
In Firefox 36, if the …Run Code Online (Sandbox Code Playgroud)