Question:

Why does this line have to be included in html files, or better said what does it do?

by  |  earlier

0 LIKES UnLike

im talking about this

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

 Tags:

   Report

5 ANSWERS


  1. Yes, it needs to be there.

    It basically informs the browser of what kind of markup is used in the code following it, allowing it to interpret and display it properly.

    At least that&#039;s my understanding.


  2. helps the brpwser identifie what type of mark up it is

    aso alows yours sute to be w3c comliant


  3. Well, it doesn&#039;t *have* to be there, your web pages will work without it but it *should* be there and it saves the web browser having to guess.

    It&#039;s purpose is to tell a web browser (Firefox, Internet Explore, Safari, etc.) what type of web code to expect.

    This one is saying that the code used is XHTML, which is different to your basic HTML and that it is &quot;Transitional&quot; as opposed to Strict or whatever the other type is.  Transitional means you can do things slightly differently to Strict, things that Strict won&#039;t let you do.

    Here is a link to W3 Schools (THE place to go, run by W3C, the web Standards people) that talks about it:

    http://www.w3schools.com/tags/tag_DOCTYP...

    DTD is short for Doc Type Declaration - that thing you&#039;re asking about is a DTD.

  4. I am lazy like you, what i do any time i created a html form, a save a copy with another name, then whenever i want to make a new one, i use my copy and only has to change the contents, and i do not have type all the other things, i guess they call it a form.

  5. &quot;An HTML document is validated against a Document Type Definition (DTD). Before an HTML file can be properly validated, a correct DTD must be added as the first line of the file.&quot;--W3Schools

    http://www.w3schools.com/html/html_whyus...

Question Stats

Latest activity: earlier.
This question has 5 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions