如何在 zend 框架中使用 border-radius.htc
我正在这些天正在从事的项目之一中构建图表绘制模块。在这个模块中,我使用 css 绘制圆圈,为了做到这一点,我必须使用 “-moz-border-radius:”属性。在 FF 下工作正常,但在 IE 下不行。为了使其在 IE 中工作,我必须使用“border-radius.htc”来解决该问题。 (我使用它就像“行为:url(border-radius.htc);”)。
现在,当我在我的 PC 上作为独立模块运行该模块时,效果很好。但是当我将代码嵌入到 Zend 框架中时,我没有看到 IE 中绘制的圆圈(在 FF 中,是的,它们出现了)。我尝试将 border-radius.htc 文件移动到 public/htc/ 目录,然后在 Behaviour: url() 属性中提供正确的 url。但没有区别。 我尝试在互联网上搜索有关此问题的信息,但找不到任何有用的信息。我需要帮助才能使其发挥作用。
有人会足够友善吗? :)
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);").
Now 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? :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在尝试让 PIE 在我的 Zend 项目中工作时遇到了同样的问题,并找到了这个解决方案:
在 css/ 目录中添加 PIE.htc 和 PIE.php 。
不要在css文件中定义behavior属性,而是在index.phtml中打开一个样式标签
并将pie类添加到您的元素中,例如
当然您可以在css文件中定义圆角类
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
And add the pie class to your element, for example
Of course you can define the rounded-corner class in your css file
您使用什么网络服务器?如果它不是 Windows 服务器 (iis),那么您需要添加 mime/type (此处的说明)
What web server are you using? If it's not a windows server (iis) then you need to add the mime/type (instructions here)
我希望这可以帮助其他尝试在 IE 中使用 Zend Framework 和 PIE.htc 功能的人。
我了解 ZF 在哪里搜索 htc 文件的步骤是:
将条目“behavior: url(htc/pie) 添加到 *.css 文件.htc);” (不带引号)
在 Web 服务器(我的例子中是 Apache)中查找日志文件,您可以在其中看到 Web 浏览器加载的文件。在我的例子中,我在 access.log 中找到了它。
我检查了 access.log文件并发现
127.0.0.1 - - [17/Feb/2012:12:55:05 +0100] "GET /stats/machines/htc/pie.htc HTTP/1.1" 404 6256
然后我修改了 *.css 文件: "behavior: url(../../htc/pie.htc);"
我去了 http://localhost/stats/machines/mem
127.0.0.1 - - [17/Feb/2012:12:56:41 +0100]“GET /htc/pie.htc HTTP/1.1”304 -
我的 *.css 更新(添加 ../../)我不是在所有情况下都有效,但是是的,这个过程展示了如何找到解决方案。我希望...:)
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:
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 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
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... :)