在html中使用欧洲字符 [英] using european characters in html

查看:112
本文介绍了在html中使用欧洲字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习HTML + CSS一两个星期前,我面临一个问题。我是欧洲的,所以我需要使用特殊字符,如á,ã,ç等等很多。有没有任何其他方式,我可以做,没有使用相应的代码为每个字母每次我需要使用一个?像一个代码,我可以放在html文档的起点,或类似的东西,将使所有的特殊字符接受。

I started learning HTML + CSS a week or two ago, and I'm facing a problem. I'm european so I need to use special characters like á, ã, ç , etc a lot. Is there any other way I can do that without using the corresponding code for each letter every time I need to use one? Like a code I can put in the beggining of the html document or something like that that would make all the special characters accepted.

推荐答案


  1. 决定要为您的网站使用的编码;如果您没有任何偏好,请使用UTF-8。

  2. 将.html文件以该编码保存在文本编辑器中。

  3. 添加< meta charset =utf-8> 到您的< head> 以指示浏览器将页面视为UTF-8编码。


    • 最好还要配置您的Web服务器输出 Content-Type:text / html; charset = utf-8 HTTP标头,因为它具有优先级(如果存在)。

  1. Decide which encoding you want to use for your site; if you don't have any preference, use UTF-8.
  2. Save the .html file in that encoding in your text editor. Consult the help of your specific text editor how to choose which encoding the file gets saved in.
  3. Add <meta charset="utf-8"> to your <head> to instruct the browser to treat the page as UTF-8 encoded.
    • Preferably also configure your web server to output a Content-Type: text/html; charset=utf-8 HTTP header, since that takes precedence if present. Consult the manual of your web server how to do that.

进一步阅读:

  • https://www.w3.org/International/tutorials/tutorial-char-enc/
  • Handling Unicode Front To Back In A Web App
  • What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text
  • UTF-8 all the way through

这篇关于在html中使用欧洲字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆