12

私はPIE.htcを使用しようとしています。これは、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);}

また、次のようにも記述されています。注:このパスは、呼び出し元のCSSファイルではなく、表示されているHTMLファイルを基準にしています。

私はCakephpを使用していますが、パスに何を入れても、PIE.htcファイルをどこに置いても機能しません。IE6で表示すると、FFのように入力に丸みを帯びた美しい角がまだありません。

4

4 に答える 4

14

絶対パスを使用してみてください。

behavior: url(/path/to/PIE.htc);

先頭のスラッシュに注意してください。このように、現在のページが何であっても、.htcファイルへのパスは同じままです。

完全なURLも機能します。

behavior: url(//example.com/path/to/PIE.htc);

完全なURLを使用する場合は、プロトコル相対URLを使用して、httpsに切り替えたときに安全でないコンテンツの警告が表示されないようにします。

IEで動作するために、多くの要素が必要であるposition:relativeか、PIEを使用する場合は、既知の問題zoom:1のページを確認し、機能するまで試してみてください。

于 2011-08-10T03:23:55.317 に答える
1

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' );
?>

それで問題は解決するはずです。

于 2012-04-20T18:53:06.533 に答える
1

私はmod_rewriteでCodeIgniterを使用していました。セプタグラムの答えに基づいて、私は以下を機能させることができました

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]

これが誰かに役立つことを願っています

于 2013-09-13T13:42:27.880 に答える
0

を使用している場合mod_rewriteは、次の小さなハックが適している可能性があります。

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

これを追加し.htaccessて出来上がり!今PIE.htcではすべてのフォルダに魔法のように存在しています:)

于 2012-10-13T08:37:35.797 に答える