任何人知道为什么这样:CSS后不工作在IE9? [英] Anyone know why this :after CSS isn't working in IE9?

查看:100
本文介绍了任何人知道为什么这样:CSS后不工作在IE9?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此提交按钮应在左侧四舍五入,并指向右侧。

This submit button should be rounded on the left side, and pointed on the right side. It's working in non-ie browsers, but in IE9, it is not working.

如果我看开发者工具中的样式,那么.flat-button:after规则有一切划掉了,好像它被某事取代了。什么?

If I look at the styles in the developer tools, the .flat-button:after rule has everything crossed out, as if it is superseded by something. What?

<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。

After playing around for a while, I found a simple fix for IE9.

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

所有你需要添加 overflow:visible .flat-button

这篇关于任何人知道为什么这样:CSS后不工作在IE9?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆