开发者

CakePhp CSS problem!

开发者 https://www.devze.com 2023-01-04 02:57 出处:网络
Problem is abou开发者_JAVA技巧t CakePhp. If I give permission to required directories CSS does not work. Sample URL:link text

Problem is abou开发者_JAVA技巧t CakePhp. If I give permission to required directories CSS does not work. Sample URL: link text

Isn't this weird?


It works in IE: It's a Firefox specific problem.

Your CSS file is not outputting the Content-type: text/css header, which makes Firefox ignore it as a style sheet. You will notice a warning to that effect in Firefox's error console.

I don't know Cake, but I'm sure there is a native way to remedy this.

A quick fix would be adding

<?php
  header("Content-type: text/css");

?>

to the top of cake.generic.css (if that is a PHP file).

If it's a real CSS file and not a rewritten URL (as I said, I don't know Cake), your web server doesn't seem to be taking care of sending the right content type - maybe something for the admin to fix.

If the admin can't fix it, you could try adding a .htaccess file to your project (or editing the existing one) containing

AddType text/css .css
0

精彩评论

暂无评论...
验证码 换一张
取 消