讓IE6,IE7,IE8,IE9支援CSS3

來源:互聯網
上載者:User

 IE6,7並不支援CSS3的屬性,IE8也不能很好的支援CSS3。如何讓ie支援border-radius (rounded), box-shadow ( shadow), text-shadow等這些屬性呢?這裡介紹一個通過htc指令碼實現這些屬性的方法。      

 

首先下載ie-css3.htc指令碼。

然後在css中加入 behavior: url(ie-css3.htc);

.box {
-moz-border-radius: 15px; /* Firefox */
-webkit-border-radius: 15px; /* Safari and Chrome */
border-radius: 15px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */

 

-moz-box-shadow: 10px 10px 20px #000; /* Firefox */
-webkit-box-shadow: 10px 10px 20px #000; /* Safari and Chrome */
box-shadow: 10px 10px 20px #000; /* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */

behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */
}

注意:behavior: url(ie-css3.htc) 中的ie-css3.htc地址用絕對路徑或者直接傳到網站的根目錄下面,要不然可能會看不到效果。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.