支持:后在IE7 [英] Support of :after in IE7

查看:108
本文介绍了支持:后在IE7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

长故事,我想在另一个元素之后添加一个绝对定位的伪元素,所以我只需在我的样式表中使用:之后的伪元素。这就像一个魅力,除了IE7。我应该认为:之后在IE7支持,没有?在Boilerplate中使用的 clearfix 黑客工作正常,为什么在我的示例中不行?

Long story short, I want to add an absolutely positioned pseudo element after another element, so I simply use the :after pseudo element in my stylesheet. This works like a charm, except in IE7. I should think that :after is supported in IE7, no? The clearfix hack used in Boilerplate works fine, so why not in my example?

当我在样式检查器中查看CSS时,它似乎打印出来,所以它似乎它理解它,但我可以看到生成的元素。我错过了什么?

When I look at the CSS in the style inspector, it does seem to print it out, so it seems to me that it understands it, but I can't see the generated element nonetheless. Am I missing something?

.myclass:after { 
   content:"";
   display:table;
   width:100px;
   height:100px;
   background:#f7f7f7;
   position:absolute;
   top:0;
   left:-1px;
   z-index:0; }
.myclass > div {
   position:relative;
   z-index:10; }   
.myclass { 
   z-index:1;
   position:relative; }

这里是小提琴

推荐答案

:和之前的 c $ c>在IE7中,您还可以使用其他选项,例如 IE8.js

There is no support for :before and :after in IE7, there are other options that you can use like IE8.js.

这篇关于支持:后在IE7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆