2010年4月14日 星期三

IE-CSS3 - 讓IE支援CSS3

轉貼自:http://ka-yue.com/blog/ie-css3

IE-CSS3 是個能令 Internet Explorer 不完整地支援幾個常用的 CSS3 屬性的小 script。它利用了 Internet Explorer 專有的 Vector Markup Language (VML) 來繪制所需效果。
使用方法很簡單,如果你需要圓角效果,只需一如以往地用 border-radius,再加上 behavior: url(ie-css3.htc) 即可:

.box {
  -moz-border-radius: 15px; /* Firefox */
  -webkit-border-radius: 15px; /* Safari and Chrome */
  border-radius: 15px; /* Internet Explorer 6+ with IE-CSS3! YEAH! and Opera */

  behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */
}
IE-CSS3 支援 Internet Explorer 6, 7 及 8,可惜支援的屬性並不是太多,僅限於 border-radius, box-shadow 及 text-shadow。並未有實際使用過,不知道大量使用的話會不會把 IE 拖慢(大概也習慣了吧?)。以往需要圓角的時候我一般會選用 DD_roundies,未曾出過問題,而 DD_roundies 也是用 VML 來 implement 的,所以相信值得一試的。
未經壓縮的檔案大小為 12KB,官方沒有壓縮版。

沒有留言:

張貼留言

Related Posts with Thumbnails