爲了得到IE 6/7/8 CSS3效果(邊界半徑,箱陰影......),我使用css3pie
。css3pie弄亂了DOM,結果在jQuery選擇錯誤
但是,css3pie在DOM中生成一些css3-container (v1)/css3pie (v2)
標記,這會使預期的體系結構出現混亂。這裏有一個例子:
CSS
pre {
border: 1px solid #aaa;
border-radius: 5px;
behavior: url(pie.htc);
}
HTML
<div class="foo">bar</div>
<p class="getme">paragraph</p>
<pre>preformatted</pre>
jQuery的
// undefined expected: getme
alert($("pre").prev().attr("class"));
// css3-container expected: p
alert($("pre").prev()[0].tagName);
// getme expected: foo
alert($("pre").prev().prev().attr("class"));
// 4 expected: 3
alert($("body").children().size());
// will not set expected: Impact
$("p+pre").css({fontFamily: "Impact"});
// it almost affects all such jQuery selctors
實際根兒如下:
<DIV class="foo">bar</DIV>
<P class="paragraph">paragraph</P>
<css3-container...>
<border...>
<shape...><stroke></stroke><stroke></stroke></shape>
</border>
</css3-container>
<PRE>preformatted</PRE>
有沒有人遇到過這種問題?任何解決方法?有沒有替代css3pie讓CSS3在IE 6/7/8上工作?
這不值得。 IE 6和7不支持微軟,那麼爲什麼你要支持他們100%? :)但嚴重的是 - 對於使用大多數互聯網看起來很糟糕的瀏覽器的人來說,圓角都很重要?使它與圓角一起工作會損害性能,並可能使舊站點無法使用該站點。 – naugtur