box-shadow IE8兼容处理
生活随笔
收集整理的這篇文章主要介紹了
box-shadow IE8兼容处理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
根據canisue(http://caniuse.com/#search=box-shadow),box-shadow兼容性如下圖所示:
?
測試代碼:
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 7 <title></title> 8 <style type="text/css"> 9 * { 10 margin: 0; 11 padding: 0; 12 } 13 14 #header { 15 width: 400px; 16 height: 400px; 17 margin: 10px; 18 background-color: #999999; 19 box-shadow: 3px 3px 5px #000; 20 } 21 </style> 22 </head> 23 24 <body> 25 <div id="header"> 26 </div> 27 </body> 28 29 </html>?
IE8瀏覽器效果:
?
border-radius在IE8瀏覽器兼容方案:
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 7 <title></title> 8 <style type="text/css"> 9 * { 10 margin: 0; 11 padding: 0; 12 } 13 14 #header { 15 width: 400px; 16 height: 400px; 17 margin: 10px; 18 background-color: #999999; 19 box-shadow: 3px 3px 5px #000; 20 /*關鍵屬性設置 需要把路徑設置好*/ 21 behavior: url(PIE.htc); 22 } 23 </style> 24 </head> 25 26 <body> 27 <div id="header"> 28 </div> 29 </body> 30 31 </html>?
?IE8瀏覽器下效果:
PIE.HTC下載地址:http://css3pie.com/
PIE可以處理CSS3的一些屬性,如:
總結
以上是生活随笔為你收集整理的box-shadow IE8兼容处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: css中px、em和rem的区别总结
- 下一篇: web前端常用知识点