The third step is to define your language encoding, similar to this:
In order to be correctly interpreted by the browser To pass W3C code verification, all XHTML documents must declare the encoding language they use. We generally use gb2312 (Simplified Chinese). It is also possible to use Unicode, ISO-8859-1, etc. to create multi-language pages, depending on your needs. definition.
Usually this definition is enough. But it should be added that the XML document does not define language encoding in this way. XML is defined as follows:
You can see a similar statement in the first line of code on the home page of Macromedia.com. This is also the definition method recommended by the W3C. So why don’t we just adopt this approach? The reason is that some browsers have incomplete support for standards and cannot correctly understand such definition methods, such as IE6/windows. Therefore, under the current transition plan, we still recommend using the meta method. Of course, you can write both ways.
Looking at the source code of this website, you will find that there is one more sentence where the language encoding is defined:
This It is written for older browsers to ensure that various browsers can correctly interpret the page.
Note: At the end of the above declaration statement, you see a slash "/", which is different from our previous HTML4.0 code writing. The reason is that XHTML syntax rules require that all tags must have a beginning and an end. For example,
and ,and
, etc. For unpaired identifiers, it is required to add a space at the end of the identifier, followed by a "/". For example,The above is the third day of building a website using Web standards: defining the content of language encoding. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!