views:

101

answers:

2

What is the purpose this and why 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"&gt;

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

A: 

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"&gt;

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"&gt;

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"&gt;

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"&gt;

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

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

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

rahul
+3  A: 

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

Matt Smith
Thanks alot.........
Muhammad Akhtar