问题
I'm trying to use CSS PIE in my website, but for some reason it's not working.
My folder structure looks like this:
And my CSS like this:
.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);
}
When I check my PIE.htc
-file in Chrome, the path links to the correct file, so it's a valid path.
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.
回答1:
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!
回答2:
You must link your PIE.php (or PIE.htc, but PIE.php is better because this include PIE.htc and you have not problem with .htaccess file) from file where you include CSS file (CSS where you are using PIE).
My situation which work: behavior: url(funkce/PIE.php);
Tree (this files/folders is on same level):
Font (folder)
funkce (folder)
img (folder)
template (folder)
slash_something.php (file)
In template folder I have folder css and in it I have CSS file where use PIE. PIE.php file I have in folder "funkce". => I muset link "funkce/PIE.php" => in your situation a tip on - behavior: url(css/pie/PIE.htc);
来源:https://stackoverflow.com/questions/14676012/css-pie-not-working-with-correct-path-to-file