I am building a chart drawing module in one of the projects I am working on these days. In this module, I am drawing circles by using css and in order to do that I have to use "-moz-border-radius: " property. It works fine in FF but not in IE. In order to make it work in IE, I have to use "border-radius.htc" as a fix to the problem. (I am using it like "behavior: url(border-radius.htc);").
N开发者_高级运维ow this works fine when I am running the module as a stand alone one on my PC. But when I embed my code in Zend framework, I do not see the circles being drawn in IE (In FF, yes they show up). I tried moving border-radius.htc file to public/htc/ directory and then providing the proper url in behavior: url() property. But no difference. I tried to search on internet regarding this issue but could not find any useful info. I need help in order to do make it work.
Would anyone be kind enough? :)
I had the same issue trying to make PIE work in my Zend project and found this solution:
Add PIE.htc and PIE.php in your css/ directory.
Don't define the behavior attribute in the css file but open a style tag in your index.phtml
<style type='text/css'>
.pie {
behavior: url(<?php echo $this->baseUrl("/css/PIE.php")?>);
}
</style>
And add the pie class to your element, for example
<div id="rounder-window" class="rounded-corners pie">
foo
</div>
Of course you can define the rounded-corner class in your css file
.rounded-corders {
border-radius: 10px;
-ms-border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
}
What web server are you using? If it's not a windows server (iis) then you need to add the mime/type (instructions here)
I hope this can help someone else, trying to use Zend Framework and PIE.htc features in IE. My steps to learn where ZF searchs for the htc file was:
- Put the htc file into the folder "/public/htc/pie.htc"
Add to the *.css file the entry "behavior: url(htc/pie.htc);" (without quotes)
Look for a log file in your Web Server (Apache in my case) where you can see the files that are being lodaded by the Web Browser. In my case I found it in access.log.
- I went to http://localhost/stats/machines/mem
I checked the access.log file and found 127.0.0.1 - - [17/Feb/2012:12:55:05 +0100] "GET /stats/machines/htc/pie.htc HTTP/1.1" 404 6256
Then I modified the *.css file with: "behavior: url(../../htc/pie.htc);"
I went to http://localhost/stats/machines/mem
- I checked the access.log file and found 127.0.0.1 - - [17/Feb/2012:12:56:41 +0100] "GET /htc/pie.htc HTTP/1.1" 304 -
My *.css update (add ../../) my not work in all cases, but yes the process that shows how to found the solution. I hope... :)
精彩评论