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

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 lovewangshu 的 blog

原文地址: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"

本文关键:[XHTML Tutorial] 走向XHTML标准 (5)(XHTML DTD)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top