原文地址:http://www.w3schools.com/xhtml/xhtml_syntax.asp the xhtml standard defines three document type definitions. the <!doctype> is mandatory the basic document structure is: the doctype declaration should always be the first line in an xhtml document. the doctype declaration defines the document type: the rest of the document looks like html: the 3 document type definitions xhtml 1.0 specifies three xml document types that correspond to three dtds: strict, transitional, and frameset. 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. xhtml 1.0 frameset
翻译:范维肖
the most common is the xhtml transitional.
xhtml标准定义了三种文档类型定义,而其中最普通的是xhtml过渡型类型定义
<!doctype>标记是强制性的
an xhtml document consists of three main parts:
一个xhtml文档是由下面三个主要部分构成的
the doctype
the head
the body
基本的文档结构是:
<!doctype ...>
<html>
<head>
<title>... </title>
</head>
<body> ... </body>
</html>
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>
doctype的声明定义了文档类型
<!doctype html
public "-//w3c//dtd xhtml 1.0 strict//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
文档剩下的部分看起来比较像html了
<html>
<head>
<title>simple document</title>
</head>
<body>
<p>a simple paragraph</p>
</body>
</html>
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指明了三种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">
当你需要充分利用html的表现层的特性或者当你想支持那些不支持css的浏览器的时候你可以使用过渡型。
<!doctype html
public "-//w3c//dtd xhtml 1.0 frameset//en"