如何在HTML中设置charset?

时间:2016-11-02 10:32:08

标签: html character-encoding meta-tags symbols letters

我在网站上遇到了麻烦。我设置了charset unicode,但它仍然无法工作。这里有一个如何设置它的示例代码:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
http://www.w3.org/TR/html4/loose.dtd>
<html lang="it">
<head>
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" charset="iso-8859-1">
    <title>HOME</title>

</head>



    <body>

        <h1> This are some accented letters and various symbol</h1>

             <p>è é ç ò ù § ▼ à </p>


    </body>


    </html>

更新

[1]: https://i.stack.imgur.com/csRk2.jpg

1 个答案:

答案 0 :(得分:0)

在head标记中添加以下行并删除您的charset

<meta charset="UTF-8">

或替换

<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="iso-8859-1">

<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8">

了解更多信息 http://www.w3schools.com/tags/att_meta_charset.asp