1

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.

DavidB
  • 45
  • 5

1 Answers1

2
  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:

Community
  • 1
  • 1
deceze
  • 510,633
  • 85
  • 743
  • 889