Opera和IE没有正确地归因于css文本修饰

Mr.*_*ith 0 html css layout opera internet-explorer

使用Opera 11和IE 9,似乎这两个浏览器没有正确地归属CSS文本修饰样式.这在Chrome,FireFox和Safari中100%有效.有没有人建议如何解决这个问题?

错误的影响:

替代文字

正确的效果:

替代文字

这是CSS:

#main_title {
    font-size: 18px;
    color: #000;
    font-weight: bold;
}

#main_title a {
    color: #000;
}

#main_title_accent {
    border: 1px solid #000;
    background: #ff9935;
    text-decoration: none;
    font-size: 20px;
    padding: 5px;
}
Run Code Online (Sandbox Code Playgroud)

这是HTML:

<div id="main_title">
    <a href="home">Text <span id="main_title_accent">Goes</span> Here</a>
</div>
Run Code Online (Sandbox Code Playgroud)

Gab*_*oli 6

你需要给display:inline-block#main_title_accent.

w3c阅读更多内容:16.3.1 - 文本修饰属性

相关报价

请注意,文本修饰不会传播到浮动和绝对定位的后代,也不会传播到原子内联级后代(如内联块和内联表)的内容.

实例:http://jsfiddle.net/qp32H/1/