小编jlo*_*wcs的帖子

在Firefox中,单击可聚焦元素内的绝对元素不会聚焦可聚焦元素,除非它具有CSS位置

上下文:可聚焦元素内的绝对元素.

在Firefox 36中,如果可聚焦元素没有CSS位置(相对,固定或绝对),则单击内部元素将不会将焦点设置为可聚焦元素...

不知道那是不是已知的bug?

在IE11和Chrome上无法再现.

为了更好地理解这个问题,这里有一个例子:

Codepen

/* 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)

css firefox position focus css-position

11
推荐指数
1
解决办法
1619
查看次数

标签 统计

css ×1

css-position ×1

firefox ×1

focus ×1

position ×1