gpt4 book ai didi

html - 共享点 CSS :after not working on IE

转载 作者:行者123 更新时间:2023-11-28 00:17:01 25 4
gpt4 key购买 nike

所以我可以很容易地让 IE8 使用 :after:

<!DOCTYPE html>
<html>
<style type="text/css">
a.styled:after
{
content:" HAHA! Business.";
color:red;
font-size:12pt;
}
</style>
<body>
Here's some text and stuff. <a href="google.com" class="styled">Here's a link.</a>
</body>
</html>

如果我将其放入文本文档并在 IE 中打开,它会显示应有的内容:“这是一个链接”,后面是红色的“哈哈!业务”。当我尝试将完全相同的代码放入 SharePoint 内容编辑器 Web 部件时,它适用于我尝试过的所有浏览器,但 Internet Explorer 除外。使用 IE,当我使用 :after 时,链接后不显示任何内容,但任何其他类型的样式都可以正常工作。给了什么?

最佳答案

在 IE 8 之前,IE 不支持 :after,即使在 IE 8 中也是如此 does not work without a doctype .你可以看看this chart of css selectors and their support了解更多信息。

既然你提到使用 IE8,我找不到任何它不能工作的理由。您的 Sharepoint Web 部件中可能有一些其他内容可能会导致问题。

您可能还对 how-do-you-work-around-ie-not-supporting-after 感兴趣或 why-is-sharepoint-dispalying-my-html-and-css-content-improperly ,在 stackoverflow 上发现了两个类似的问题。

关于html - 共享点 CSS :after not working on IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11637153/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com