The third step is to define your language encoding, like this:
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
To be correctly interpreted by the browser and passed by W3CCodeCheck, all XHTML documents must declare the encoding language they use, we generally use gb2312 (Simplified Chinese), the production of multi-language pages may also use Unicode, ISO-8859-1, etc, according to your needs.
Generally, this can be defined. However, the XML document does not define language encoding as follows:
<? XML version = "1.0" encoding = "gb2312"?>
You can see similar statements in the first line of macromedia.com homepage code. This is also the definition method recommended by W3C. Why don't we use this method directly? The reason is that some browsers do not fully support the standard and cannot correctly understand such definition methods, such as IE6/windows. Therefore, we recommend that you use Meta In the current transition scheme. Of course, you can write both methods.
View this siteSource codeYou will find that there is another sentence in the definition of language encoding:
<Meta http-equiv = "content-language" content = "gb2312"/>
This is intended for earlier browsers to ensure that all browsers can correctly interpret the page.
Note: At the end of the preceding statement, you can see a slash "/", which is different from the code written in html4.0. The reason is that the XHTML syntax rules require that all identifiers must start and end. Such as <body> and </body>, <p>, and </P>. For unpaired identifiers, a space must be added at the end of the identifiers, then follow "/". For example, <br> written as <br/> and written as . The reason for adding spaces is to prevent the code from being connected together and the browser does not recognize it.