当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <html>标签

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML <html>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 412 ::
收藏到网摘: n/a

定义与用法

This element tells a browser that this is an HTML document.
该元素可以让浏览器知道这是一份HTML文档


它在HTML和XHTML中的区别

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>
</head>

<body>
...
...
...
</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元素内的文字会显示在浏览器上。

评论 (0) All

登陆 | 还没注册?