CSS :before and :after are not working in IE8

标签 css internet-explorer-8 pseudo-element

使用 :before 和 :after 创建一个右下角带有三 Angular 形的 div 容器,以创建带有白色边框的橙色三 Angular 形。在 FF 和 Chrome 中运行良好。在 IE8 中不工作。尝试调整 z-index 和其他属性,但无法弄清楚这里出了什么问题。感谢您的帮助。

 .homepage-banner-main:after { 
     content: " ";
     position: absolute;
     z-index: 100;
     bottom: 0px;
     right:5px;
     border-top: 100px solid transparent;
     border-bottom: 0px solid transparent; 
     border-right:100px solid #e66c23; 
     zoom:1;
 }

 .homepage-banner-main:before { 
     content: " ";
     position: absolute;
     z-index: 100;
     bottom: 0px;
     right:5px;
     border-top: 110px solid transparent;
     border-bottom: 0px solid transparent; 
     border-right:110px solid white; 
     zoom:1; 
 }

      <div class="homepage-banner-main" id="banner-1" >
          <img src="http://fillmurray.com/g/710/400" >
      </div>

最佳答案

可能有很多原因。在我的脑海中,你能检查一下吗:

  1. 您的页面未在 Quirks 模式下运行。
  2. 您的页面正在通过 HTML 验证(转到 W3C Validator 进行快速检查。)

关于CSS :before and :after are not working in IE8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25312436/

相关文章:

html - :before pseudo element won’t center in IE8 (Internet Explorer 8)

html - 两个背景水平在 div 一个圆形 div

css - 扩展的可点击区域在 Firefox 中不起作用

html - ul li 在 div 左侧对齐和对齐

css - 并排表格在 Outlook 中不起作用

javascript - 在单独的文件中重写prototype.js中的getOffsetParent()函数

javascript - ajax 在 IE8 及以上版本中不工作

css - 为什么这是 :after element being affected by line breaks?

css - 移动菜单切换到文本

javascript - 将鼠标悬停在带有 textarea 的 div 元素上不起作用