CSS3和PIE不工作在IE 8 [英] CSS3 and PIE not working in IE 8

查看:138
本文介绍了CSS3和PIE不工作在IE 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



HTML:

 <!DOCTYPE HTML PUBLIC -  // W3C // DTD HTML 4.01 Transitional // EN> 
< html>
< head>
< meta http-equiv =content-typecontent =text / html; charset = windows-1250>
< link href =test.csstype =text / css =stylesheet>
< title>测试< / title>
< / head>
< body>

< div id =title>< / div>
< div id =sub_title>< / div>
< div id =main_area>
< div id =date_area>< / div>
< / div>

< / body>
< / html>

css:

 code> body {
margin:0 auto;
}

#title {
margin:0 auto;
width:100%;
height:40px;
background-color:white;
}

#sub_title {
margin:0 auto;
width:100%;
height:25px;
background-color:green;
}

#date_area {
width:310px;
height:250px;
border:1px solid#4A4949;
padding:60px 0;
text-align:center;
-webkit-border-radius:1px;
-moz-border-radius:1px;
border-radius:1px;
-webkit-box-shadow:#707070 2px 2px 4px;
-moz-box-shadow:#707070 2px 2px 4px;
box-shadow:#707070 2px 2px 4px;
background:#EBEBEB;
background:-webkit-gradient(linear,0 0,0 bottom,from(#EDEBEB),to(#C9C7C8));
background:-moz-linear-gradient(#EDEBEB,#C9C7C8);
background:linear-gradient(#EDEBEB,#C9C7C8);
-pie-background:linear-gradient(#EDEBEB,#C9C7C8);
behavior:url(/PIE.htc);
}

结果只是一个带边框的块,没有渐变/阴影等



任何帮助/解决方案都将非常感激。

解决方案

code>行为位置应该是相对于你的HTML文件,而不是你的CSS像任何其他声明使用 url()。假设你的 index.html PIE.htc 在root中,而你的CSS位于'css'你应该这样:

  background-image:url(../ images / example.jpg); 
behavior:url(PIE.htc);

此外,尝试添加 .htaccess 文件其中以下内容位于与 PIE.htc 文件相同的位置:

  AddType text / x-component .htc 

希望这有帮助。


Im trying to demo CSS3PIE and it wont work in IE at all.

HTML:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <link href="test.css" type="text/css" rel="stylesheet">
  <title>Test</title>
  </head>
  <body>

    <div id="title"></div>
    <div id="sub_title"></div>
    <div id="main_area">
      <div id="date_area"></div>
    </div>

  </body>
</html>

css:

body{
 margin: 0 auto;
}

#title{
 margin: 0 auto;
 width: 100%;
 height: 40px;
 background-color: white;
}

#sub_title{
  margin: 0 auto;
  width: 100%;
  height: 25px;
  background-color: green;
}

#date_area{
  width: 310px;
  height: 250px;
  border: 1px solid #4A4949;
  padding: 60px 0;
  text-align: center; 
  -webkit-border-radius: 1px;
  -moz-border-radius: 1px;
  border-radius: 1px;
  -webkit-box-shadow: #707070 2px 2px 4px;
  -moz-box-shadow: #707070 2px 2px 4px;
  box-shadow: #707070 2px 2px 4px;
  background: #EBEBEB;
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(#EDEBEB), to(#C9C7C8));
  background: -moz-linear-gradient(#EDEBEB, #C9C7C8);
  background: linear-gradient(#EDEBEB, #C9C7C8);
  -pie-background: linear-gradient(#EDEBEB, #C9C7C8);
  behavior: url(/PIE.htc);  
}

The result is just a block with a border, no gradient/shadow etc

Any help/solution would be much appreciated.

解决方案

The behavior location should be relative to your HTML file, not your CSS like any other declaration using url(). So assuming your index.html and PIE.htc is in root and your CSS is inside a 'css' folder, you should go like this:

background-image: url(../images/example.jpg);
behavior: url(PIE.htc);

Also, try adding a .htaccess file with the following content in the same location as the PIE.htc file:

AddType text/x-component .htc

Hope this helps.

这篇关于CSS3和PIE不工作在IE 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆