[英]CSS Transform Property - Inconsistent results on IE9 & IE10
標題:CSS轉換屬性-IE9和IE10上的結果不一致
當在IE9和IE10上查看時,下面的沼澤標准w3schools演示代碼執行不一致。 問題是無法識別轉換屬性。
使用本地存儲在計算機(即台式機)中的文件打開時有效
在共享驅動器(如Web服務器)上的存儲中打開時失敗,但直接訪問(不通過http訪問)
通過http參考打開共享中的相同文件時有效。
試圖找出差異化因素。
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 200px;
height: 100px;
background-color: yellow;
/* Rotate div */
-ms-transform: rotate(7deg); /* IE 9 */
-webkit-transform: rotate(7deg); /* Chrome, Safari, Opera */
transform: rotate(7deg);
}
</style>
</head>
<body>
<div>Hello</div>
<br>
<p><b>Note:</b> Internet Explorer 8 and earlier versions do not support the transform property.</p>
<p><b>Note:</b> Internet Explorer 9 supports an alternative, the -ms-transform property. Newer versions of IE support the transform property (do not need the ms prefix).</p>
<p><b>Note:</b> Chrome, Safari and Opera supports an alternative, the -webkit-transform property.</p>
</body>
</html>
最新的w3schools代碼為
div {
-ms-transform: rotate(7deg); /* IE 9 */
-webkit-transform: rotate(7deg); /* Chrome, Safari, Opera */
transform: rotate(7deg);
}
看起來問題出在某些情況下瀏覽器切換到Quirks模式,而解決方法是將其添加到頂部...
<meta http-equiv="x-ua-compatible" content="IE=Edge"/>
我認為這仍然是強制執行最新標准模式的有效代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.