CSS Pie无法使用正确的文件路径 [英] CSS Pie not working with correct path to file

查看:175
本文介绍了CSS Pie无法使用正确的文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的网站中使用CSS PIE,但是由于某些原因,它无法正常工作.

I'm trying to use CSS PIE in my website, but for some reason it's not working.

我的文件夹结构如下:

My folder structure looks like this:

我的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文件时,该路径会链接到正确的文件,因此它是有效路径.

When I check my PIE.htc-file in Chrome, the path links to the correct file, so it's a valid path.

尽管CSS Pie警告我有关Note: this path is relative to the HTML file being viewed, not the CSS file it is called from的信息,但这对我也不起作用...因此,其他某些问题一定是错误的,我也不知道该怎么办.

And although the CSS Pie warns me about Note: this path is relative to the HTML file being viewed, not the CSS file it is called from, that's not working for me either... So something else must be wrong and I don't have any idea what.

推荐答案

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

The path in behavior: url(...); must be relative to the HTML file in which you are using that style, not relative to the CSS file!

这篇关于CSS Pie无法使用正确的文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆