After the DOCTYPE is declared, the next code is:
<html xmlns=" http://www.w3.org/1999/xhtml " lang="gb2312">
Usually our HTML4.0 code is just <html>. What is "xmlns" here?
This "xmlns" is the abbreviation of XHTML namespace, which is called "namespace" declaration. What is the role of namespace? Ajie’s own understanding is:
Since xml allows you to define your own identity, the identity you define may be the same as the identity defined by others, but have different meanings. Errors can easily occur when files are exchanged or shared. To avoid this error, XML uses namespace declarations, which allow you to identify your identity through a URL pointing to it. For example:
Both Xiao Wang and Xiao Li have defined a <book> tag. If Xiao Wang's name space is " http://www.xiaowang.com ", Xiao Li's name space is " http://www.xiaoli.com " , then when the two documents exchange data, the <book> identifier will not be confused because it belongs to different namespaces.
A more popular explanation is: a namespace is to mark a document to tell others who this document belongs to. It's just that this "who" is replaced by a website address.
XHTML is a markup language that transitions from HTML to XML. It needs to comply with XML document rules, so it also needs to define a namespace. And because XHTML1.0 cannot customize the logo, its namespace is the same, which is " http://www.w3.org/1999/xhtml ". It doesn't matter if you don't quite understand it yet, at this stage we just need to copy the code.
The following lang="gb2312" specifies that your document uses Simplified Chinese.