这个html打开为什么是乱码啊?明明设置了编码

<!DOCTYPE html>
<html>
  <head>
    <title>1.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
   <table class="table table-hover" id="tblSort">
                            <thead>
                                <tr>
                                <th onClick="sortTable('tblSort',0,'int')" style="cursor:pointer">时间</th>
                                 <th onClick="sortTable('tblSort',1,'int')" style="cursor:pointer">金额</th>
                                 <th onClick="sortTable('tblSort',2,'int')" style="cursor:pointer">人数</th>
                                    ………………
                                    
                                </tr>
                                </thead>
 </table>
  </body>
 
</html>
请输入代码
阅读 3.5k
3 个回答

用的是eclipse的话,右键该文件,properties--> resourse看一下编码格式

原因很简单,你的这段代码编码没设置好。把这段代码剪切,新建一个空文件,把代码复制进去,保存的时候,选择utf-8就好了。

看看报错的文件编码是不是UTF-8无bom

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题