html文件中文乱码怎么办解决(html文件中文乱码怎么办解决)

lxf2023-03-14 16:32:02

html文件中文乱码的解决办法:首先打开会乱码的HTML文件;然后添加了一行语句为“<meta http-equiv="Content-Type"content="text/html;charset=utf-8">”即可。

html文件中文乱码怎么办解决(html文件中文乱码怎么办解决)

本文操作环境:windows7系统、HTML5&&CSS3版,DELL G3电脑。

html文件中文在浏览器中显示乱码问题解决

利用浏览器打开html文件时,中文显示乱码,如下是原文件的内容

<html>
     <head>
       <title>狗熊王</title>
     </head>
  
    <body>
         <p>狗熊王</p>
      <p>http://blog.csdn.net/mybelief321</p>
     </body>
 </html>

出现乱码

添加了一行 <meta http-equiv="Content-Type"content="text/html;charset=utf-8">,如下

<html>
      <meta http-equiv="Content-Type"content="text/html;charset=utf-8">
         <head>
           <title>狗熊王</title>
        </head>
 <body>
          <p>狗熊王</p>
         <p>http://blog.csdn.net/mybelief321</p>
        </body>
 </html>

此时就不乱码了

以下是查找的资料:

   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta http-equiv="Content-Language" content="zh-CN" />
   <meta name="author" content="Csdn" />
 <meta name="Copyright" content="Csdn" />
   <meta name="description" content="" />
   <meta content="" name="keywords" />

第一行说明了他的文字编码

第二行说明了他采用的语言

第三行说明了他的作者

第四行说明了他的版权

第五行是对网站的简单描述

第六行是说明了本网站的关键字

后边两行主要是被百度这些搜索网站检索的时候用的 非常重要

【推荐学习:HTML视频教程】

以上就是html文件中文乱码怎么办的详细内容,更多请关注AdminJS其它相关文章!