当前位置: 首页 > 网络学院 > 设计教程 > 设计理念 > XHTML和样式表

设计理念
网站常见错误
如何让你的业务在10天之内失败
网站设计的7个要点
图片真的比文字更胜一筹吗?
规模扩张与你的站点
网站设计的十大错误
网站设计准则
确保网站的加载速度
创建具有友好性的研究型网站
htaccess 简易教程
Htaccess简介
在你的网页链接和图片中使用“Title”标签
测试你的网站开发者
设计搜索引擎亲睐的网站
创建真正的logo
使用框架来优化网站设计
10条设计/行销准则
XHTML和样式表
网站模仿
迅速提高你的销售业绩

设计理念 中的 XHTML和样式表


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

Briefly...
简述

The web is changing. The web is actually changing everyday; different languages, algorithms, concepts, and ideas. It seemed as if, after learning HTML, I started hearing rumors of XHTML.

网络正在改变。事实上,网络每日都在发生变化;不同的语言、运算法则、概念和思维。正如你刚学完了HTML,似乎XHTML又隐约出现了。

Introduction to XHTML
XHTML
简介

XHTML (eXtensible Hypertext Markup Language) is the redefinition in XML of HTML defined in SGML. XHTML1.0 became a W3C Recommendation on January 26th, 2000 as the redefinition of HTML 4.0/4.01. XHTML has a high affinity with both HTML and XML, and is expected to be the description language of Web contents that can be processed by XML-compliant tools. XHTML 1.1 became a W3C Recommendation on May 31st, 2001. In addition, XHTML Basic became a W3C Recommendation as a subset of XHTML for mobile devices. As of right now, there is a working draft of XHTML 2.0. The new version will include Ruby support and a few other very important new modules that, yet again, make the web more dynamic and well-formed.

XHTML
(扩展超文本标记语言),它是通用标记语言标准下HTMLXML范畴内的定义。XHTML1.02000126作为W3C的推荐标准,即:HTML 4.0 / 4.01XHTMLHTMLXML关系密切。人们普遍期待着它能够作为遵循XML的用于描述网页内容语言的工具。XHTML 1.12001331编程W3C的推荐标准。另外,XHTML Basic作为W3C推荐的关于开发手机设备的XHTML语言中的一个子集。到现在为止,已经拥有了XHTML 2.0工作草案。新版本将包含珍贵的支持以及非常重要的全新模式,再者,它可以使整个网站看上去更富动态,并且很好地定义了网站的形式。

The Ten Commandments of XHTML
XHTML
的十诫

XHTML, as with anything and everything else in life, has rules. If there weren't any rules, where would the web be? (That's a whole other topic) So there are ten basic rules, as set out by the W3C, for an XHTML document; also known as, the ten commandments of XML:

XHTML
就像生活中的每一种事例一样,有其自己的准则。如果没有规则存在,那么何来网络?(这是另外一个话题了)因此,这里有十条针对Xhtml文档的准则,是由W3C发布的;与XML的十诫雷同:

1.      XHTML/XML shall be straightforwardly usable over the Internet.
XHTML/XML
应该在互联网中正当使用。

2.      XHTML/XML shall support a wide variety of applications.
XHTML/XML
应该支持各种类型的应用程序。

3.      XHTML/XML shall be compatible with SGML.
XHTML/XML
应该符合SGML [ 通用标记语言标准 ]

4.      It shall be easy to write programs which process XHTML/XML documents.
对于执行XHTML/XML文档的程序书写应该非常简便

5.      The number of optional features in XHTML/XML is to be kept to the absolute minimum, ideally zero.
XHTML/XML
的附加功能应该绝对少,甚至没有。

6.      XHTML/XML documents should be human-legible and reasonably clear.
XHTML/XML
文档应该清晰易读。

7.      The XHTML/XML design should be prepared quickly.
使用XHTML/XML进行设计应该具备方便快捷的特征。

8.      The design of XHTML/XML shall be formal and concise.
XHTML/XML
的设计应该正规并且简明。

9.      XHTML/XML documents shall be easy to create.
XHTML/XML
文档应该易于创建。

10.  Terseness in XHTML/XML markup is of minimal importance.
是否需要简化XHTML/XML标记并不重要

These guidelines must be followed to create a well-formed, validated XHTML document.

创建形式优秀的、有效的XHTML文档必须遵循这些准则。

Basics You MUST Know
你必须知道的准则

In an XHTML document, there are a few things that must be a "standard". These are the rules that must be followed to correctly validate an XHTML document.

XHTML文档内部,有些东西必须符合所谓的“标准”。如果你希望正确地创建有效的XHTML文档,那么,你必须遵循这些准则:

1.      XHTML elements must be properly nested
XHTML
元素必须被合理嵌套

2.      XHTML documents must be well-formed
XHTML
文档必须格式精确

3.      Tag names must be in lowercase
小写字母定义标签

4.      All XHTML elements must be closed
所有的XHTML元素必须有结束符

1.      Properly nested elements mean that you can't improperly nest within each other like this:

适当得嵌套元素意味着你不能像下面这样非法嵌套标签:

<i><b>This is bold, italic text</i></b>

Which should actually be this to be properly nested:

应该像下面这样进行嵌套;

<i><b>This is bold, italic text</b></i>

2.      Well-formed documents are a must, and at the same time, can help you maintain a very good structure for not only XHTML, but programming too.

必须定义正确格式的文档,同时,它可以帮助你保持一个很好的结构,这不仅仅是对于XHTML来说的,同时也包括整段程序。

XHTML elements must be nested within the <html> root element. While the other elements can have child elements. Child elements must be in pairs and correctly nested within their parent element:

XHTML
元素必须嵌套在<html>根元素中。然而,其它元素可以包含子元素。子元素必须成对出现,并且被正确地嵌套在它们的父元素中:

<div>
<p><strong>This is a paragraph!</strong></p>
<p>The turkey ran away from the butcher</p>
</div>

3.      Lowercase is a MUST !!! A lot of people, as I have seen, like to capitalize HTML code; this is a no-no in XHTML:

必须使用小写字母!!!我看到很多人喜欢用大写字母的形式来书写HTML代码,但这对于XHTML来说,绝对不行:

<A HREF="page.html">Link Here!</A>

Now with XHTML you must have all code in lowercase, like so:
   
   
现在,只要是关于XHTML的代码,你必须全部使用小写字母的形式,就像下面这样:
   

<a href="page.html">Link Here!</a>

4.      All tags must be closed. Yes, even empty tags. Empty tags are the tags that, in HTML 4.0/4.01, that weren't required to be closed; break tag, horizontal rule tag, etc:

所有的标签必须有结束符。甚至是空标签。在HTML4.0 / 4.01中,空标签不要求有对应的结束标签,如:换行符<br>,段落标签<p>等等:

<p>
This is a paragraph!<br>
And I have some text right below it!

In XHTML, you would find this code written as:

XHTML中,你会发现上述代码应该以下面的形式书写:

<p>
This is a paragraph!<br />
And I have some text right below it!
</p>

You must follow at least those four basic steps of XHTML in order to correctly validate you XHTML code.

你至少遵循上述的四条XHTML的基本准则,目的是为了正确地创建行之有效的XHTML代码。

XHTML...XML??
Anyone confused of where XML comes into the picture? Have you heard of XML and XHTML having something in common? Well, partly they do, and partly they don't. HUH?

XHTML…XML
??
很多人都困惑,到底XML的那点引起了人们的注意?你听说过XMLXHTML的共同性吗?是的,它们有些内容类似,但有些却存在不同。嗯哼?

Let's get to the point. XHTML is a markup language written in XML; therefore, it is an XML application. So XML is a part of XHTML; that's why you must have complete, well-formed documents that validate entirely in order to call your document XHTML. The "Ten Commandments of XHTML" are the same as XML. The rules go hand in hand. So, a quick, non-technical description of XHTML is: XHTML is a hybrid between HTML and XML.

让我们切入主题吧。XHTML是一种用XML写成的标记语言;因此,它是一个XML应用程序。所以,XMLXHTML的一部分;这就是为什么你要很好的定义文档格式,是之整体有效的原因,只是为了能够称它为XHTML文档。“XHTML的十诫”与XML相同。规则互通。因此,XHTML简练而非专业的描述就是:XHTMLHTMLXML的混血儿。

XHTML uses three XML namespaces (used to qualify element and attributes names by associating them with namespaces identified by URI references. Namespaces prevent identically custom-named tags that may be used in different XML documents from being read the same way), which is like the three HTML 4.0 DTDs: Strict, Transitional, and Frameset.

XHTML
使用三种XML

评论 (0) All

登陆 | 还没注册?