开发者

DocType HTML Attribute

What is the purpose this and wh开发者_C百科y this be added when we add new aspx page?

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

What I have got behviour is, When I remove from page, the design look good and my modal popup is not working in IE only but working on Mozila, and when I add this design disturbed and modal popup working fine.

Thanks


the doctype tells the browser what sort of rendering mode to use when rendering the web page. this can have effects on CSS layouts and cross browser development. Eric Meyer has a good article explaining it indepth.

http://www.ericmeyeroncss.com/bonus/render-mode.html

The one you point out there makes the browser view the html as XHTML 1.0 the full list of doc types allowed is here;

http://www.w3.org/QA/2002/04/valid-dtd-list.html


Read

A valid HTML document declares what version of HTML is used in the document. The document type declaration names the document type definition (DTD) in use for the document

HTML version information

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

The Transitional type is used when HTML presentational features are included in the document instead of in a style sheet. This is done to accomodate older browsers that don't support CSS.

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

The Frameset type is used in documents that have frames.

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

The same three document types are also used in XHTML 1.0:

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

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

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

Since the declaration is actually a comment tag, it won't confuse older browsers that don't understand the statement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜