using european characters in html

前端 未结 1 725
情话喂你
情话喂你 2021-01-16 13:44

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 wa

相关标签:
1条回答
  • 2021-01-16 14:23
    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.
    4. Write literally any character you can input directly as is into your document and enjoy.

    Further reading:

    • 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
    0 讨论(0)
提交回复
热议问题