現在CSS3仍不支援IE8以下(包含IE8)
所以在設定圓角、陰影、漸層(Gradient Background)等,在IE都沒有效果
所以都要另外做圖片來滿足
使用CSS3-PIE 裡面的PIE.htc可以滿足你喲!步驟如下:
Step 1: Download it
Download the PIE distribution and unzip it somewhere.
Step 2: Upload it
Inside the unzipped directory, you will find a file named PIE.htc. This is the behavior file for IE, and is what does all the magic. Upload this file to the server where you're going to serve pages using CSS3. It doesn't matter where exactly, as long as you know where it is.
Step 3: Write some CSS3
Assuming you already have a HTML document, let's say you want to give one of its elements rounded corners. Create a CSS rule for that element and give it a border-radius style like so:
#myAwesomeElement { border: 1px solid #999; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; }
(Note the -webkit- and -moz- prefixed versions; these are necessary to make the rounded corners work in WebKit and Mozilla-based browsers.)
Step 4: Apply PIE
In that same CSS rule, add the following style line:
behavior: url(path/to/PIE.htc);
Of course you will need to adjust the path to match where you uploaded PIE.htc in step 2. Note: this path is relative to the HTML file being viewed, not the CSS file it is called from.
留言列表