在Internet Explorer 8中生成内容的文本对齐 [英] Text-alignment of generated content in Internet Explorer 8
问题描述
我正在调试此网站,并尝试解决Internet Explorer中出现的一些问题(大惊喜)
I'm debugging this site and trying to sort out some issues that arise in Internet Explorer (big surprise).
我在几个链接中添加了一个子标题,如下所示:
I'm adding a sub-title to several links as follows:
.subtitle a:after {
content:"The Subtitle Here";
}
在所有现代浏览器(和IE9)使用 text-align:center;
。但是,在IE8中,字幕在这里被清空。
On all modern browsers (and IE9) the content is center aligned because the container uses text-align:center;
. However, in IE8 "The Subtitle Here" is flushed left.
有什么办法控制CSS吗?
Is there any way to control that with CSS?
感谢。
推荐答案
结果你可以轻松做到:
我添加了另一个定位添加内容的样式规则...
I added another style rule that targets the added content...
.subtitle a:after {
text-align:center;
}
我想IE9和其他浏览器继承了 align
属性为:之后
内容,但IE8不。 IE总是让它有趣...
I guess IE9 and other browsers inherit the text-align
property for :after
content but IE8 doesn't. IE always keeps it interesting...
这篇关于在Internet Explorer 8中生成内容的文本对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!