当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <html>标签
This element tells a browser that this is an HTML document.
该元素可以让浏览器知道这是一份HTML文档
The xmlns attribute is required in XHTML but not in HTML. However, the validator on w3.org does not complain when this attribute is missing from the <html> tag in an XHTML document. This is because "xmlns=http://www.w3.org/1999/xhtml" is a fixed value and will be added to the <html> tag even if you do not include it.
在XHTML中需要xmlns属性,而在HTML中就不需要了。然而即使当XHTML文档中没了这个属性在w3.org的校验器也不会因此而混淆。这是因为<html>标签里的"xmlns=http://www.w3.org/1999/xhtml"已经固定住了,就算没有写也依然存在。
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <body> </html> |
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)
属性 | 值 | 描述 | DTD |
---|---|---|---|
xmlns | http://www.w3.org/1999/xhtml | Defines the XML namespace attribute 定义XML命名空间 | STF |
dir, lang, xml:lang |
For a full description, go to Standard Attributes.
查看完整的属性
A very simple HTML document
A very simple HTML document, with only a minimum of HTML tags. It demonstrates how the text inside a body element is displayed in the browser.
一个非常简单的HTML文档,里面只有少量的HTML标签。在这个演示中那些在body元素内的文字会显示在浏览器上。