4

I've seen some CSS library has this code

@charset "UTF-8";

However, my website has already specified this meta tag

<meta charset="utf-8" />

I want to keep the website's meta tag.

Now, can I remove the line @charset "UTF-8"; in CSS?

Are these two identical?

Joseph
  • 3,974
  • 7
  • 34
  • 67
  • Same thing but in two different places. One is called in `style` and the other is called in `head`. If you want to learn more about charset, click [here](https://www.w3.org/International/questions/qa-html-encoding-declarations) – myjobistobehappy Nov 18 '20 at 06:07
  • @myjobistobehappy yes, but there are some things to keep in mind. This question was already asked and received an answer [here](https://stackoverflow.com/a/2526055/6232435). – rojadesign Nov 18 '20 at 06:49
  • Not sure what the doubt is. HTML and CSS are different languages, thus have different constructs with different syntax. In both cases, that's the last resort way to set encoding because, at that point, the browser has already read the file. – Álvaro González Nov 18 '20 at 08:47

0 Answers0