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

HTML
HTML 介绍
HTML 元素
HTML 基本标签
HTML 格式
HTML 实体字符
HTML 链接
HTML 框架
HTML 表格
HTML 列表
HTML 表单
HTML 图片
HTML 背景
HTML 颜色
HTML 颜色值
HTML 颜色名
HTML 便条
HTML 布局
HTML 字体
HTML 4.0
HTML 样式

HTML <html>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 411 ::
收藏到网摘: 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

登陆 | 还没注册?