韩国设计资源网广告
HTML中DOCTYPE的定义及用法
作者:佚名 文章来源:网络收集 点击数: 更新时间:2007-7-30 0:24:21
推荐给QQ/MSN好友:
The <!DOCTYPE> declaration is the very first thing in your document, before the <html> tag. This tag tells the browser which HTML or XHTML specification the document uses.

Note: The <!DOCTYPE> tag does not have an end tag! 

HTML
HTML 4.01 specifies three document types: Strict, Transitional, and Frameset.


HTML Strict DTD

Use this when you want clean markup, free of presentational clutter. Use this together with Cascading Style Sheets (CSS):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 
HTML Transitional DTD

The Transitional DTD includes presentation attributes and elements that W3C expects to move to a style sheet. Use this when you need to use HTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 

Frameset DTD
The Frameset DTD should be used for documents with frames. The Frameset DTD is equal to the Transitional DTD except for the frameset element replaces the body element: 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> 

XHTML
XHTML 1.0 specifies three XML document types: Strict, Transitional, and Frameset.


XHTML Strict DTD

Use this DTD when you want clean markup, free of presentational clutter. Use this together with Cascading Style Sheets (CSS):

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

Use this DTD when you need to use XHTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS):

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

Use this DTD when you want to use frames!

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

To check that you have written a valid XHTML document with a correct DTD,  you can link your XHTML page to an XHTML validator.
  • 下一篇教程: 没有了
  • 热门设计教程
    推荐教程 Photoshop教程变照片为卡通漫画[05-18]
    推荐教程 Photoshop超酷海报效果[05-18]
    推荐教程 photoshop鼠绘美女[04-23]
    推荐教程 超简单ps蕾丝边框教程[05-21]
    推荐教程 照片处理 Photoshop修饰漂亮美女[07-02]
    推荐教程 用photoshop制作羽毛扇[04-07]
    推荐教程 Photoshop教程Photoshop蒙板全攻[05-28]
    推荐教程 字母标志设计[08-30]
    推荐教程 Photoshop通道法为漂亮MM抠图实例[08-24]
    推荐教程 Photoshop相片处理实例 芙蓉姐姐[08-24]
    推荐设计教程
    推荐教程 照片处理 Photoshop简单制作照片[07-23]
    推荐教程 Photoshop打造Sinsuo!非主流效果[07-23]
    推荐教程 Photoshop制作非主流可爱羞红脸蛋[07-23]
    推荐教程 Photoshop打造“非主流”颓废照片[07-23]
    推荐教程 Photoshop把非主流美女的眼睫毛变[07-23]
    推荐教程 照片处理 Photoshop制作逼真的影[07-20]
    推荐教程 Photoshop打造漂亮的塑料风格枫叶[07-20]
    推荐教程 鼠标手绘:大众甲壳虫汽车的制作[07-20]
    推荐教程 Photoshop轻松绘制韩式卡通风格云[07-20]
    推荐教程 Photoshop图片合成[蒙板全揭密][07-20]