Home >Web Front-end >HTML Tutorial >Building a website using web standards Day 2: What is a namespace
After the DOCTYPE is declared, the next code is:
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 logo, the logo you define may be the same as the logo 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
A more popular explanation is: 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.
The above is the second day of building a website using Web standards: what is the content of a namespace? For more related content, please pay attention to the PHP Chinese website (www.php.cn)!