Home >Web Front-end >CSS Tutorial >The solution to the problem that tornado has no effect after loading css

The solution to the problem that tornado has no effect after loading css

黄舟
黄舟Original
2017-10-26 10:16:042840browse

I used tornado to create a simple page. The css in the result page is loaded, but has no effect. Use Google Chrome to debug, it says Resource interpreted as Stylesheet but transferred with MIME type application/x-css. The general meaning is that the css file is recognized as a style sheet, but it is transferred in application/x-css format. This causes the browser to be unable to display the page properly and the css to not work at all. The reason is that web.py in tornadod will call mimetypes.guess_type()

The solution to the problem that tornado has no effect after loading css

when setting content_type. And when mimetypes is initialized, if In the windows environment, the local registry will be read.

The solution to the problem that tornado has no effect after loading css

So just change the Content Type of the css file in the registry from applicntion/x-css

The solution to the problem that tornado has no effect after loading css

to text/css is enough.

The solution to the problem that tornado has no effect after loading css

The above is the detailed content of The solution to the problem that tornado has no effect after loading css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn