:after和:之前的css伪元素hack为IE 7 [英] :after and :before css pseudo elements hack for IE 7
问题描述
我使用:之后
和:之前
css伪元素,它在 IE8 和所有现代浏览器,但在 IE7 中无法正常工作。有没有已知的黑客可以在 IE7 ?
可能。
使用IE8.js http://代码。 google.com/p/ie7-js/
它支持此功能。 http://ie7-js.googlecode.com/svn/test/index.html
测试页面
之后 - http://ie7-js.googlecode.com/svn/test/after.html
之前 - http://ie7-js.googlecode.com/svn/test/before.html
$ b
在第一条评论后编辑
7.其他浏览器不会读取它。
<! - [if lt IE 8]
< script src =http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js>< / script>
<![endif] - >
如果你已经在你的项目中使用了jQuery,你可以使用这个插件
jQuery伪插件
http://jquery.lukelutman.com/plugins/pseudo/
I am using :after
and :before
css pseudo elements and it is working fine in IE8, and all modern browsers but it is not working fine in IE7. Are there known hacks to work around this in IE7?
with any pure CSS hack it's not possible.
Use IE8.js http://code.google.com/p/ie7-js/
It has support for this. http://ie7-js.googlecode.com/svn/test/index.html
test page also there
after - http://ie7-js.googlecode.com/svn/test/after.html
before - http://ie7-js.googlecode.com/svn/test/before.html
Edit after 1st comment
You can just keep this js for IE6 and 7. other browser will not read it.
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
And if you are already using jQuery in your project than you can use this plugin
jQuery Pseudo Plugin
http://jquery.lukelutman.com/plugins/pseudo/
这篇关于:after和:之前的css伪元素hack为IE 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!