CSS Pie无法使用正确的文件路径

时间:2013-02-03 18:53:00

标签: css3pie

我正在尝试在我的网站上使用CSS PIE,但由于某些原因它无效。

我的文件夹结构如下所示:
enter image description here

我的CSS就像这样:

.region-sidebar-first-inner .block-menu-block-1 {
  background: #730868;
  margin-bottom: 70px;
  background: -webkit-gradient(linear, 0 0, 0 bottom, from(#730868), to(#0a9f9d));
  background: -webkit-linear-gradient(top, #730868 0%, #0e70a2 76%,#0a9f9d 100%);
  background: -moz-linear-gradient(top, #730868 0%, #0e70a2 76%,#0a9f9d 100%);
  background: -ms-linear-gradient(top, #730868 0%, #0e70a2 76%,#0a9f9d 100%);
  background: -o-linear-gradient(top, #730868 0%, #0e70a2 76%,#0a9f9d 100%);
  background: linear-gradient(top, #730868 0%, #0e70a2 76%,#0a9f9d 100%);
  -pie-background: linear-gradient(top, #730868 0%, #0e70a2 76%,#0a9f9d 100%);
  behavior: url(pie/PIE.htc);
}

当我在Chrome中检查我的PIE.htc - 文件时,该路径会链接到正确的文件,因此它是一个有效的路径。

尽管CSS Pie警告我Note: this path is relative to the HTML file being viewed, not the CSS file it is called from,但这对我也不起作用......所以别的东西一定是错的,我什么都不知道。

2 个答案:

答案 0 :(得分:1)

behavior: url(...);中的路径必须相对于您使用该样式的HTML文件,而不是相对于CSS文件!

答案 1 :(得分:0)

您必须从包含CSS文件的文件(您所在的CSS)链接您的PIE.php(或PIE.htc,但PIE.php更好,因为这包括PIE.htc并且您对.htaccess文件没有任何问题)。使用PIE)。

我的情况有效: 行为:url(funkce / PIE.php);

树(此文件/文件夹位于同一级别):
字体(文件夹)
funkce(文件夹)
img(文件夹)
模板(文件夹)
slash_something.php(file)

在模板文件夹中我有文件夹css,在其中我有CSS文件,其中使用PIE。 PIE.php文件我在文件夹“funkce”中。 =>我muset链接“funkce / PIE.php” =>在您的情况下提示 - 行为:url(css / pie / PIE.htc);