css - 任何人都知道为什么这个 :after CSS isn't working in IE9?

标签 css internet-explorer-9 pseudo-element

This submit button左边应该是圆的,右边是尖的。它在非 ie 浏览器中工作,但在 IE9 中,它不工作。

如果我查看开发人员工具中的样式,.flat-button:after 规则将所有内容都划掉了,就好像它被某些东西取代了一样。什么?

<button type="submit" class="flat-button">Submit</button>
<style>
.flat-button {
    float: left;
    position: relative;
    border-top-left-radius: 5px;
    -moz-border-top-left-radius: 5px;
    -webkit-border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    -moz-border-bottom-left-radius: 5px;
    -webkit-border-bottom-left-radius: 5px;
    border: none;
    padding: 0 12px;
    margin: 0 3px 3px 0;
    outline: none;
    cursor: pointer;
    color: white;
    font-family:'Trebuchet MS', Arial, helvetica, Sans-Serif;
    font-size: 14px;
    font-weight: bold;
    font-style: italic;
    text-decoration: none;
    border-collapse: separate;
    height: 26px;
    line-height: 26px;
    background: #5191cd;
}
.flat-button:hover {
    background: #1c3f95;
}
.flat-button:after {
    position: absolute;
    content: ' ';
    height: 0;
    width: 0;
    left: 100%;
    border: 13px solid transparent;
    border-left-color: #5191cd;
}
.flat-button:hover:after {
    border-left-color: #1c3f95;
}
</style>

最佳答案

玩了一会儿后,我找到了一个针对 IE9 的简单修复。

http://jsfiddle.net/thirtydot/BWC9q/10/

您所要做的就是将 overflow: visible 添加到 .flat-button

关于css - 任何人都知道为什么这个 :after CSS isn't working in IE9?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10560138/

相关文章:

css - Ruby on Rails - 覆盖 application.css

jquery - 如何在不影响其他 div 的情况下放大 div onmouseenter(或悬停)?

jquery - 可移动和可调整大小的 div,子 div 可以随之调整大小吗?

css - IE9 中的渐变 : using "filter: none" doesn't work

CSS 列表项换行到下一行 - 但仅在 IE 9 中

html - 如何在同一个类中使用多个 css 内容

HTML 伪元素放置在实际子节点上

jquery - Twitter Bootstrap 轮播 : Change background outside carousel-element

html - ie9 中的 'not' css 选择器

css - 伪元素中的字体系列