css - 制作 :active work at the children node in IE

标签 css internet-explorer internet-explorer-9 pseudo-class

HTML:

<div class="productCss">
    <figure>
        <img src="pic/products/pullet00001.png" alt="this is a picture">
        <figcaption>some product word2</figcaption>
    </figure>
</div>

CSS:

.productCss {
    border: black 1px solid;
}

.productCss:hover {
    border: blue 2px solid;
    cursor: pointer;
}

.productCss:active {
    border: blue 3px solid;
    cursor: pointer;
}

Demo

这个问题只在IE中出现。

当我的光标移入并在空白处按下鼠标时,IE 确实可以像其他浏览器一样完美地工作。

但是,如果我在 or 区域上按下鼠标,IE 不会像 productCss:active 那样将边框更改为 3px。

我可以只使用 css 解决这个问题吗?

最佳答案

情况一:.productCss被边缘点击

  • 它适用于 IE 和其他浏览器。 :active 状态为真

情况 2:点击图形

为了强调,我们设置了 figure { border: 1px solid red; }

  • 它适用于其他浏览器。 :active 状态为真
  • 它在 IE 中不起作用。

这是为什么?我猜 IE 的行为如下:我们不点击 .productCss,而是点击 figure。因此只有 figure:active 状态,父 div 没有。

关于css - 制作 :active work at the children node in IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20859783/

相关文章:

css - 纵向模式下的整页背景

jQuery 协调切换

javascript - 如何使用 TweenMax 在 IE 中制作翻转卡片?

jquery - Internet Explorer 8+ - 通过 jquery 填充选择不会扩大选择范围

javascript - JQuery:将新单元格附加到表格并循环遍历它们在 FF、Chrome 中有效,但在 IE 中无效

asp.net - <盖亚 :DateTimePicker> does not align with grid in IE9

css - IE 9 复选框大小调整

jquery - HTML 输入类型文件样式更改不起作用

css - 将鼠标悬停在波浪线上

internet-explorer - ie9 文档类型和字体?