標籤:style class blog code ext color
css3 pie使用方法:
<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> .style{ border: 1px solid #669966; padding: 60px 0pt; text-align: center; width: 200px; font-size:18px; font-family:"sans-serif"; border-radius: 8px; box-shadow: #666 0px 2px 3px; background: -webkit-gradient(linear, 0 0, 0 bottom, from(#EEFF99), to(#66EE33)); background: -webkit-linear-gradient(#EEFF99, #66EE33); background: -moz-linear-gradient(#EEFF99, #66EE33); -pie-background: linear-gradient(#EEFF99, #66EE33); behavior: url(PIE.htc); position:relative; z-index:10; } </style></head><body> <div class="style">css3 pie.htc DEMO</div></body></html>
特別提醒:
1、behavior的url裡一定要填寫htc檔案的絕對路徑(不管你用的是pie外掛程式還是別的htc檔案),因為 IE瀏覽器找該檔案是相對當前html檔案路徑來找的,所以對於Wordpress等動態程式產生的頁面一定要填寫絕對路徑。
2、一定要有定位屬性:position:relative;
3、因為在IE瀏覽器下這些CSS3效果的實現是要藉助於VML,由VML繪製圓角或是投影效果,所以還需要一個z-index屬性。z-index屬性最好設定得比較大,如2。
4、如果在IE瀏覽器下某些模組無法用此渲染,可以試著絕對位置相應的層,即加上“ width: 400px; height:400px;”屬性。
5、radius屬性的10px是圓角半徑,還可以給兩個值如“border-radius: 10px 5px;”,這樣則左上方與右下角半徑為10px,右上方與左下角半徑為5px。也可以賦4個值,為“上 右 下 左”。