[XHTML Tutorial] 走向XHTML标准 (5)(XHTML DTD)

类别:网站制作 点击:0 评论:0 推荐:
原文地址:http://www.w3schools.com/xhtml/xhtml_syntax.asp
翻译:范维肖

The XHTML standard defines three Document Type Definitions.
The most common is the XHTML Transitional.
XHTML标准定义了三种文档类型定义,而其中最普通的是XHTML过渡型类型定义

The <!DOCTYPE> Is Mandatory
<!DOCTYPE>标记是强制性的
An XHTML document consists of three main parts:
一个XHTML文档是由下面三个主要部分构成的
the DOCTYPE
the Head
the Body

The basic document structure is:
基本的文档结构是:
<!DOCTYPE ...>
<html>
<head>
<title>... </title>
</head>
<body> ... </body>
</html>

The DOCTYPE declaration should always be the first line in an XHTML document.
DOCTYPE的声明应该总是出现在一个XHTML文档的第一行

An XHTML Example
一个XHTML的例子
This is a simple (minimal) XHTML document:
这是一个简单的XHTML文档的例子
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>simple document</title>
</head>
<body>
<p>a simple paragraph</p>
</body>
</html>

The DOCTYPE declaration defines the document type:
DOCTYPE的声明定义了文档类型
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The rest of the document looks like HTML:
文档剩下的部分看起来比较像HTML了
<html>
<head>
<title>simple document</title>
</head>
<body>
<p>a simple paragraph</p>
</body>
</html>

The 3 Document Type Definitions
3种文档类型定义
1.DTD specifies the syntax of a web page in SGML.
2.DTD is used by SGML applications, such as HTML, to specify rules that apply to the markup of documents of a particular type, including a set of element and entity declarations.
3.XHTML is specified in an SGML document type definition or 'DTD'.
4.An XHTML DTD describes in precise, computer-readable language the allowed syntax and grammar of XHTML markup.
1.DTD指明了在SGML(通用标记语言标准)下的网页的语法
2.DTD被SGML应用程序所使用,像HTML,为了指明一种特定类型文档的标记的规则,它包括一个对元素和整个实体声明的设定。
3.XHTML被指定在一个SGML文档类型或DTD中
4.XHTML DTD的精确描述,使得计算机能够识别的语言允许语法和XHTML标记的文法可以使用。
There are currently 3 XHTML document types:
三种XHTML文档类型:
STRICT
TRANSITIONAL
FRAMESET
严格型
过渡型
框架型

XHTML 1.0 specifies three XML document types that correspond to three DTDs: Strict, Transitional, and Frameset.
XHTML 1.0指明了三种XML文档类型来适应三种DTD:严格型,过渡型和框架型

XHTML 1.0 Strict
严格型
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets.
当你想要整洁干净的标记,避免表现层的混乱,把它和CSS一起使用

XHTML 1.0 Transitional
过渡型
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets.
当你需要充分利用HTML的表现层的特性或者当你想支持那些不支持CSS的浏览器的时候你可以使用过渡型。

XHTML 1.0 Frameset
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Use this when you want to use HTML Frames to partition the browser window into two or more frames.
当你使用HTML框架把一个浏览器窗口分割成两个或多个时候使用框架型结构

(转载请注明出处)

The <!DOCTYPE> Is Mandatory
<!DOCTYPE>标记是强制性的
An XHTML document consists of three main parts:
一个XHTML文档是由下面三个主要部分构成的
the DOCTYPE
the Head
the Body

The basic document structure is:
基本的文档结构是:
<!DOCTYPE ...>
<html>
<head>
<title>... </title>
</head>
<body> ... </body>
</html>

The DOCTYPE declaration should always be the first line in an XHTML document.
DOCTYPE的声明应该总是出现在一个XHTML文档的第一行

An XHTML Example
一个XHTML的例子
This is a simple (minimal) XHTML document:
这是一个简单的XHTML文档的例子
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>simple document</title>
</head>
<body>
<p>a simple paragraph</p>
</body>
</html>

The DOCTYPE declaration defines the document type:
DOCTYPE的声明定义了文档类型
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The rest of the document looks like HTML:
文档剩下的部分看起来比较像HTML了
<html>
<head>
<title>simple document</title>
</head>
<body>
<p>a simple paragraph</p>
</body>
</html>

The 3 Document Type Definitions
3种文档类型定义
1.DTD specifies the syntax of a web page in SGML.
2.DTD is used by SGML applications, such as HTML, to specify rules that apply to the markup of documents of a particular type, including a set of element and entity declarations.
3.XHTML is specified in an SGML document type definition or 'DTD'.
4.An XHTML DTD describes in precise, computer-readable language the allowed syntax and grammar of XHTML markup.
1.DTD指明了在SGML(通用标记语言标准)下的网页的语法
2.DTD被SGML应用程序所使用,像HTML,为了指明一种特定类型文档的标记的规则,它包括一个对元素和整个实体声明的设定。
3.XHTML被指定在一个SGML文档类型或DTD中
4.XHTML DTD的精确描述,使得计算机能够识别的语言允许语法和XHTML标记的文法可以使用。
There are currently 3 XHTML document types:
三种XHTML文档类型:
STRICT
TRANSITIONAL
FRAMESET
严格型
过渡型
框架型

XHTML 1.0 specifies three XML document types that correspond to three DTDs: Strict, Transitional, and Frameset.
XHTML 1.0指明了三种XML文档类型来适应三种DTD:严格型,过渡型和框架型

XHTML 1.0 Strict
严格型
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets.
当你想要整洁干净的标记,避免表现层的混乱,把它和CSS一起使用

XHTML 1.0 Transitional
过渡型
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets.
当你需要充分利用HTML的表现层的特性或者当你想支持那些不支持CSS的浏览器的时候你可以使用过渡型。

XHTML 1.0 Frameset
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Use this when you want to use HTML Frames to partition the browser window into two or more frames.
当你使用HTML框架把一个浏览器窗口分割成两个或多个时候使用框架型结构

(转载请注明出处)

本文地址:http://com.8s8s.com/it/it30936.htm