gpt4 book ai didi

css - :after pseudoclass on IE7

转载 作者:行者123 更新时间:2023-11-28 11:48:29 24 4
gpt4 key购买 nike

我有这段代码,它使用纯 CSS 显示了一个小三 Angular 形,它适用于所有现代浏览器,包括 IE8-IE9:

<html>
<head>
<style>
.arrow:after {
display: inline-block;
width: 0;
height: 0;
margin: 4px 0 0 4px;
vertical-align: top;
text-indent:-9999px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid black;
content: "&darr;";
}
</style>
</head>
<body>
<div class="arrow">testing</div>
</body>
</html>

问题是它在 IE7 上不工作,它只是不显示箭头。

我看到有人建议使用 ie8.js,但它也不起作用。

有人知道如何让它在 IE7 上运行吗?

最佳答案

是的,这在不使用 JS 插件的情况下在 IE7 中是可能的。不要让反对者愚弄你。这是您更新后的代码:

<html>
<head>
<style type="text/css">
.arrow:after {
display: inline-block;
width: 0;
height: 0;
margin: 4px 0 0 4px;
vertical-align: top;
text-indent:-9999px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid black;
content: "&darr;";
}
.arrow {*zoom: expression( this.runtimeStyle.zoom="1", this.appendChild( document.createElement("i")).className="ie-after" );}
.arrow .ie-after {*zoom: expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = '&darr;');}
</style>
</head>
<body>
<span class="arrow">testing</span>
</body>
</html>​

关于css - :after pseudoclass on IE7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8206228/

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