Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python简单http服务器时不加载字体_Python_Html_Font Awesome_Simplehttpserver - Fatal编程技术网

使用Python简单http服务器时不加载字体

使用Python简单http服务器时不加载字体,python,html,font-awesome,simplehttpserver,Python,Html,Font Awesome,Simplehttpserver,我有一个简单的html文件,它使用字体awesome显示拇指向下的图标 <html> <script src="//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script> <script> WebFont.load({ custom: { families: ['FontAwesome'], urls : ['//netd

我有一个简单的html文件,它使用字体awesome显示拇指向下的图标

<html>
  <script src="//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
  <script>
    WebFont.load({
      custom: {
      families: ['FontAwesome'],
      urls : ['//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css']
    },
    fontloading: function(familyName, fvd) {},
    fontactive: function(familyName, fvd) {},
    fontinactive: function(familyName, fvd) {
    }});
  </script>
  <style type="text/css">
  html{
    background-color:black;
    color:green;
  }

  .thumb_down:before {
      content:"";
      font-family: FontAwesome;
      color: #ffffff;
  }

  </style>

  <body>
    <div class="thumb_down">I am here! </div>
  </body>
</html>  

但是当我使用php服务器托管相同的程序时,我得到了正确的结果,如fiddle所示

php -S localhost:9000

知道这是否是python简单HTTP服务器的一个限制吗?

可能是编码的问题。PHP可能正在添加一个标头,而python则没有。如果在
标记后添加这个(就像JSFIDLE一样),它可能会工作

<head>
    <meta charset="utf-8"> 
</head>

这就解决了它!谢谢:)
<head>
    <meta charset="utf-8"> 
</head>