Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 当我';我使用cakephp_Internet Explorer_Css_Css3pie - Fatal编程技术网

Internet explorer 当我';我使用cakephp

Internet explorer 当我';我使用cakephp,internet-explorer,css,css3pie,Internet Explorer,Css,Css3pie,我正在尝试使用,这是一个脚本,希望它能让我在IE6-8中使用CSS3特性。我也在使用Cakephp(我越来越喜欢它) 根据说明,我只需将PIE.htc文件粘贴到我想要的任何位置,然后添加behavior:url(path/to/PIE.htc)到CSS。因此,我: input[type=text]{ width:348px; height:30px; border:1px solid #ddd; padding:3px; background:url(..

我正在尝试使用,这是一个脚本,希望它能让我在IE6-8中使用CSS3特性。我也在使用Cakephp(我越来越喜欢它)

根据说明,我只需将PIE.htc文件粘贴到我想要的任何位置,然后添加
behavior:url(path/to/PIE.htc)到CSS。因此,我:

input[type=text]{
    width:348px;
    height:30px;
    border:1px solid #ddd;
    padding:3px;
    background:url(../img/formfieldbg.gif) repeat-x;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    vertical-align:top;
    behavior: url(path/to/PIE.htc);}
它还表示:注意:此路径是相对于正在查看的HTML文件,而不是从中调用它的CSS文件


我使用的是Cakephp,无论我为路径设置了什么,也不管我将PIE.htc文件放在哪里,我都无法让它工作!当我在IE6中查看它时,我的输入仍然没有像在FF中那样可爱的圆角。

尝试使用绝对路径:

behavior: url(/path/to/PIE.htc);
请注意前面的正斜杠。这样,无论当前页面是什么,指向
.htc
文件的路径都将保持不变

完整的URL也可以:

behavior: url(//example.com/path/to/PIE.htc);
如果您确实使用完整的url,请使用一个url,以便在切换到https时不会收到不安全的内容警告


很多元素需要
position:relative
zoom:1
在IE中使用PIE时,请确保检查页面并在其正常工作之前进行播放。

您需要指定PIE.php文件。其内容如下:

<?php
/*
This file is a wrapper, for use in PHP environments, which serves PIE.htc using the
correct content-type, so that IE will recognize it as a behavior.  Simply specify the
behavior property to fetch this .php file instead of the .htc directly:

.myElement {
    [ ...css3 properties... ]
    behavior: url(PIE.php);
}

This is only necessary when the web server is not configured to serve .htc files with
the text/x-component content-type, and cannot easily be configured to do so (as is the
case with some shared hosting providers).
*/

header( 'Content-type: text/x-component' );
include( 'PIE.htc' );
?>


这应该可以解决问题。

如果您碰巧正在使用
mod_rewrite
,那么以下小技巧可能适合您:

RewriteRule /PIE.htc$ PIE.htc [L]

将此添加到
.htaccess
中,瞧!现在,
PIE.htc
神奇地出现在每个文件夹中:)

我正在使用CodeIgniter,并进行修改。根据Septogram的回答,我得出以下结论

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

#if the url contains PIE.php redirect to the folder containing PIE.php
RewriteCond %{REQUEST_URI} PIE.php$
RewriteRule ^.*$ css3pie/PIE.php [NC,L]

#else just redirect to index
RewriteRule ^.*$ index.php [NC,L]

希望这对某人有所帮助

您好,谢谢您的回答。我试着用正斜杠,我的行为是:url(/PIE.htc);我试着把PIE.htc文件放在app/in-app/webroot-in-app/views等中,但它似乎还是没有收到效果。你知道哪里出了问题吗?感谢您是否尝试直接导航到url(在地址栏中)以确保您可以访问它?请尝试将它与CSS文件放在同一个目录中。是的,如果我输入localhost/myproject/PIE.htc,它会出现在地址栏中。我已经试着把文件放得到处都是了。defo应该在文本输入字段上使用边框半径,不是吗。
行为:url(/PIE.htc)
行为:url(/myproject/PIE.htc)应该适合您(取决于项目的根实际所在的位置)。它应该在输入上工作,但为了确保它正在加载,我建议在PIE的主页上复制/粘贴示例中的HTML/CSS,直到您看到它工作为止。如果您正在使用.htaccess,您可能还需要将
AddType text/x-component.htc
添加到.htaccess。您好,非常感谢您的帮助。我尝试在一个新页面上进行测试,不使用输入,只使用普通div,我发现当我有以下行为时:url(/myproject/PIE.htc);它有效果。但不幸的是,其效果是完全删除边框-输入文本框将完全消失?!?但至少它一定是在收集htc文件,因为它有一些效果。我猜我的另一个css肯定有什么问题,导致了奇怪的行为?朱莉娅