2011-12-07 28 views
1

我使用的是this blog 中提到的向导的不错风格,但不幸的是它在IE中无法正常工作,因为正如博客中提到的:之后使用:以及之前:Internet Explorer版本6和7中的选择器

对于不支持的浏览器:在/之前/ nth-child之后,代码将不起作用。

所以有什么办法可以解决这个问题,使IE浏览器能够很好地工作。

仅供参考,CSS是:

#wizHeader li .prevStep 
{ 
    background-color: #669966; 
} 
#wizHeader li .prevStep:after 
{ 
    border-left-color:#669966 !important; 
} 
#wizHeader li .currentStep 
{ 
    background-color: #C36615; 
} 
#wizHeader li .currentStep:after 
{ 
    border-left-color: #C36615 !important; 
} 
#wizHeader li .nextStep 
{ 
    background-color:#C2C2C2; 
} 
#wizHeader li .nextStep:after 
{ 
    border-left-color:#C2C2C2 !important; 
} 
#wizHeader 
{ 
    list-style: none; 
    overflow: hidden; 
    font: 18px Helvetica, Arial, Sans-Serif; 
    margin: 0px; 
    padding: 0px; 
} 
#wizHeader li 
{ 
    float: left; 
} 
#wizHeader li a 
{ 
    color: white; 
    text-decoration: none; 
    padding: 10px 0 10px 55px; 
    background: brown; /* fallback color */ 
    background: hsla(34,85%,35%,1); 
    position: relative; 
    display: block; 
    float: left; 
} 
#wizHeader li a:after 
{ 
    content: " "; 
    display: block; 
    width: 0; 
    height: 0; 
    border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */ 
    border-bottom: 50px solid transparent; 
    border-left: 30px solid hsla(34,85%,35%,1); 
    position: absolute; 
    top: 50%; 
    margin-top: -50px; 
    left: 100%; 
    z-index: 2; 
} 
#wizHeader li a:before 
{ 
    content: " "; 
    display: block; 
    width: 0; 
    height: 0; 
    border-top: 50px solid transparent; 
    border-bottom: 50px solid transparent; 
    border-left: 30px solid white; 
    position: absolute; 
    top: 50%; 
    margin-top: -50px; 
    margin-left: 1px; 
    left: 100%; 
    z-index: 1; 
} 
#wizHeader li:first-child a 
{ 
    padding-left: 10px; 
} 
#wizHeader li:last-child 
{ 
    padding-right: 50px; 
} 
#wizHeader li a:hover 
{ 
    background: #FE9400; 
} 
#wizHeader li a:hover:after 
{ 
    border-left-color: #FE9400 !important; 
} 
.content 
{ 
    height:150px; 
    padding-top:75px; 
    text-align:center; 
    background-color:#F9F9F9; 
    font-size:48px; 
} 
+0

http://stackoverflow.com/questions/4181884/after-and-before-css-pseudo-classes-hack-for-ie-7重复 – dash

回答

1

的前后CSS元素应该在IE8的工作和最多。

对于IE7,您可以使用类似于IE7.js黑客在之后添加伪元素支持。

我会建议使用条件语句来包含文件,如;

<!--[if IE 7]> 
    insert script here 
<![endif]--> 

对于IE6,我个人不会打扰,只是优雅地退化。

另一种选择是to use ie-css3.js

相关问题