0

It is all right in development environment, but online.

The site url: http://www.petanne.com/chart/

The CSS url: http://www.petanne.com/static/css/chart.css

All of them can be visited. But the css is no use. Why?

Thanks in advance!

Other: I use nginx act as agent for static files. It is a django project.

petanne
  • 35
  • 6

2 Answers2

1

Your server is serving .css files with MIME type text/plain. It should be text/css. Just tell your server administrator and they will fix it for you.

If you see the console in chrome, it says:

Resource interpreted as Stylesheet but transferred with MIME type text/plain.

And in firefox:

The stylesheet was not loaded because its MIME type, "text/plain", is not "text/css".

dashtinejad
  • 6,193
  • 4
  • 28
  • 44
  • I found an workaround on the http://stackoverflow.com/a/11875443/2416308. Add `include /etc/nginx/mime.types;` to nginx.conf, In location /static/ {}. It will make sure the right mime types. – petanne Aug 28 '14 at 07:53
0

See Validator results

You have several errors, including the CSS part:

Line 23, Column 69: end tag for "link" omitted, but OMITTAG NO was specified

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Anyways, despite the CSS line, take a look at the results and try to fix all errors, these are very easy fixes and will make your page work properly

Devin
  • 7,690
  • 6
  • 39
  • 54