CSS3PIE Not Working With border-radius [duplicate]

▼魔方 西西 提交于 2019-12-19 04:05:03

问题


I am trying to get CSS3PIE to work for my site so I can use border-radius in IE8 (and earlier). It works fine in all other browsers. Here's my CSS:

#body_text_design{
    border:2px solid black;
    background-color:#CCC;
    background-image:url(../pics/designbg.png);
    font-family:"Britannic Bold";
    color:black;
    height:676px;
    width:675px;
    -webkit-border-radius:10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    margin-top:23px;
    overflow:hidden;
    behavior: url(PIE.htc);
    }

And my HTML:

<div id="body_box">
    <div id="body_text_design">

    <div class="design_text_div">
    <h1>Test test test</h1>
    <br />
    <br />
    <br />
    <h3>Bla bla bla</h3> 
    <h3>Test test test</h3>
    </div>

    </div>
</div>

I have tried all the debugging that I could find such as:

  • tried the PHP solution
  • tried a full http:// link to the PIE.htc file
  • added AddType text/x-component .htc to my .htaccess file
  • tried position:absolute and zoom:1 and z-index values.

Nothing has worked so far. I envy those that have gotten this just by adding the behavior property to their CSS. If anybody could help, that would be greatly appreciated!

EDIT

Here's a jsfiddle:

http://jsfiddle.net/3aWVH/1/


回答1:


Make sure you are not testing locally. .htc files needs to be hosted on server and css3 pie will work only in web container




回答2:


I was struggling with this problem for awhile and finally figured it out!

Some servers don't recognize the .htc file so you have to add the Content-type to your .htaccess file by putting this:

AddType text/x-component .htc

It's on the known issues page of the documentation http://css3pie.com/documentation/known-issues/




回答3:


I have access to the .htaccess but it made no difference adding AddType text/x-component .htc, however using the PIE.php did work (although I had been using a mistyped path at first so took me 3 days to work out that the php really did work all along!)... anyway, all looking good now!



来源:https://stackoverflow.com/questions/9107018/css3pie-not-working-with-border-radius

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!