Results 1 to 4 of 4

Thread: Why Doctype declaration is there in HTML?

  1. #1
    Join Date
    Nov 2008
    Posts
    88

    Why Doctype declaration is there in HTML?

    I have seen when we create any file in the Html format, there is a declaration of Doctype, what does it mean and how does it help, and if we don't declare Doctype then what will happen. Because I have tried out when I had started coding in HTML that simple code was also running properly so what is the need of Doctype declaration in Html format.

  2. #2
    Join Date
    Oct 2008
    Posts
    98

    Re: Why Doctype declaration is there in HTML?

    The doctype declaration should be the very first thing in an HTML document, before the <html> tag. The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in. The <!DOCTYPE ...> declaration (technically it's not a "tag") should be the very first thing in your document... if you choose to use it at all. <!DOCTYPE ...> tells the browser what version of HTML you are writing in.

  3. #3
    Join Date
    Feb 2006
    Posts
    90

    Re: Why Doctype declaration is there in HTML?

    DOCTYPE is short for Document Type. When you declare the HTML DOCTYPE, you tell the browser which version of HTML that a Web page uses. The doctype declaration refers to a Document Type Definition (DTD). field indicates whether the identifier is a publicly accessible object (PUBLIC) or a system resource (SYSTEM) such as a local file or URL.The DTD specifies the rules for the markup language, so that the browsers can render the content correctly. HTML/XHTML DTDs are specified by PUBLIC identifiers. This is called a DOCTYPE declaration. Because there are multiple versions of HTML, browsers use the DOCTYPE declaration to determine how to render the page.

    Typical HTML DOCTYPE statement:
    Code:
    <!DOCTYPE  	 HTML  	 PUBLIC  	 "-// 	W3C// 	DTD  	 HTML 4.0 Transitional// 	EN" >

  4. #4
    Join Date
    Apr 2008
    Posts
    117

    Re: Why Doctype declaration is there in HTML?

    There are multiple versions of HTML, and each version of HTML may have multiple DTDs because each DTD has a different set of requirements.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
    "http://www.w3.org/TR/REC-html40/strict.dtd">
    If the public text changes for any reason, a new Public Text Description string should be created for it. If you add DOCTYPE declarations to your Web pages without designing them according to that standard, your Web pages may not validate and may render differently than expected or desired.

Similar Threads

  1. Doctype issue
    By Cisco-s in forum Software Development
    Replies: 3
    Last Post: 25-11-2009, 10:15 PM
  2. Final Tybsc result declaration date 2009
    By niketmulye in forum Education Career and Job Discussions
    Replies: 1
    Last Post: 09-06-2009, 12:37 PM
  3. Maharashtra Board HSC 2009 Result Declaration Date
    By attitude.ashwin in forum Education Career and Job Discussions
    Replies: 5
    Last Post: 04-06-2009, 08:14 AM
  4. Replies: 1
    Last Post: 28-02-2009, 07:10 PM
  5. Difference between Implicit and Explicit Declaration
    By vinodpathak_214 in forum Software Development
    Replies: 3
    Last Post: 16-01-2009, 10:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,063,635.09529 seconds with 17 queries