html - IE 8 上带有背景颜色的超链接( anchor )按钮不起作用

标签 html css

我尝试设置超链接按钮“”的背景颜色样式,它在 Chrome、IE9、Firefox 等上运行良好,但 IE 8 除外。经过进一步调查,我发现 IE8 不支持 button:not(.t-button) 之类的 css它打破了

我想知道我是否需要在不同的文件上为 IE 8 添加不同的 css,或者我可以更新语法以使其不会因 IE 8 而中断。

button:not(.t-button), .btn, a.btn, input[type="button"], input[type="submit"] {
    display: inline-block;
    padding: 0px 10px;
    border: none;
    margin: 6px 0 0;
    height: 24px;
    background-color: rgb(64,141,198);
    font-family: 'Arial' ,sans-serif;
    font-weight: bold;
    font-size: 1em; /* 12 */
    line-height: 2em;
    color: rgb(255,255,255);
    cursor: pointer;
    box-shadow: none;
    -webkit-appearance: none;
}

这是类似 http://jsfiddle.net/786wF/ 的 jsFiddle

我们将不胜感激任何帮助。

问候 巴韦什

最佳答案

首先:不支持非伪选择器

更多信息:

其次,您的 html 无效,将 div 放在 anchor 内

将内部 DIV 替换为 SPAN

IE 会欣赏

第三:jsfiddle 不支持 IE < 8

关于html - IE 8 上带有背景颜色的超链接( anchor )按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14573103/

相关文章:

html - Chrome CSS Perspective 不适用于所有 block

jquery - z-index 未设置为某个值

类似 HTML5/CSS3 的软件 UI 设计?

javascript - 代码在 jsfiddle 中有效,但在 html 页面中无效

javascript - 检测移动设备

html - 如何将 CSS 转换应用于特定 Angular div 元素?

html - 当一个 div 位于另一个宽度为 90% 的 div 中时,如何使它占据页面的整个宽度

javascript - 如何删除 iframe 上的图像、播放?使用 JavaScript

jquery - 如何停止这种恼人的 css 行为

ios - 链接不会在 iOS 独立网络应用程序的 iframe 目标中打开