[英]Why can't I get csspie to work?
我有一個div想要顯示為一個小的彩色圓圈。 我使用border-radius屬性添加了圓角,這當然可以在Firefox,Chrome甚至IE9中完美運行,但不能在早期版本的IE中使用。 我試圖使用CSSPIE渲染早期版本的IE中的圓角。 我下載了PIE.htc並將其保存在我的css文件夾中。
這是我的CSS的要點:
width: 25px;
height: 25px;
background-color: red;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
behavior: url(/PIE.htc);
但是,div仍然在IE7和8中顯示為紅色方塊而不是圓形。 我究竟做錯了什么?
更換:
behavior: url(/PIE.htc);
附:
behavior: url("PIE.htc");
編輯
來自文檔 :
IE解釋相對於源HTML文檔的行為屬性的URL,而不是像所有其他CSS屬性一樣相對於CSS文件。 這使得調用PIE行為不方便,因為URL必須是:
1. Absolute from the domain root — this makes the CSS not easily moveable between directories — or, 2. Relative to the HTML document — this makes the CSS not easily reusable between different HTML files.
將路徑更改為相對於HTML文件而不是相對於css文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.