Home > Article > Web Front-end > A brief discussion on HTML doctype and encoding
DOCTYPE
Doctype is to tell the browser which version of html to use to parse instructions. It must be on the first line. In some versions, DTD needs to be introduced. HTML5 does not need to introduce DTD
Chinese garbled characters
Cause
The encoding format of the browser parsing code is inconsistent with the source code encoding format. For example, if the document is saved as GBK, garbled characters will appear
Solution
Whichever format is used to parse, whichever encoding format is used to save the code.
The above article briefly discussing HTML doctype and encoding is all the content shared by the editor. I hope it can give you a reference, and I also hope that everyone will support the PHP Chinese website.
For more articles related to the doctype and encoding of HTML, please pay attention to the PHP Chinese website!