Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. Founder, SEOChat.com :)
    SEO Chat Skiller (1500 - 1999 posts)

    Join Date
    Dec 2002
    Location
    Florida, Madrid, Berlin, Dublin
    Posts
    1,820
    Rep Power
    526

    DOCTYPE Declaration!


    I know what the W3C declaration is, but I've never fully understood why it's so important declare the HTML version by placing this type of line in the code .. Would anyone care to explain??

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    I've never seen errors caused by pages not containing this declaration.
  2. #2
  3. Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Mar 2003
    Posts
    328
    Rep Power
    16

    Re: DOCTYPE Declaration!


    Originally posted by "Darrin Ward"

    I know what the W3C declaration is, but I've never fully understood why it's so important declare the HTML version by placing this type of line in the code .. Would anyone care to explain??

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    I've never seen errors caused by pages not containing this declaration.
    I got this far

    http://www.w3.org/TR/WCAG10-TECHS/#tech-identify-grammar

    before I got too confused by the circular nature of the info on the web site.
  4. #3
  5. No Profile Picture
    Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    May 2003
    Location
    New Zealand
    Posts
    139
    Rep Power
    16
    This is from homesite's help:

    HTML version information
    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 (see [ISO8879]).

    HTML 4.01 specifies three DTDs, so authors must include one of the following document type declarations in their documents. The DTDs vary in the elements they support.

    The HTML 4.01 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents. For documents that use this DTD, use this document type declaration: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">


    The HTML 4.01 Transitional DTD includes everything in the strict DTD plus deprecated elements and attributes (most of which concern visual presentation). For documents that use this DTD, use this document type declaration: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


    The HTML 4.01 Frameset DTD includes everything in the transitional DTD plus frames as well. For documents that use this DTD, use this document type declaration: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">


    The URI in each document type declaration allows user agents to download the DTD and any entity sets that are needed. The following (relative) URIs refer to DTDs and entity sets for HTML 4:

    "strict.dtd" -- default strict DTD
    "loose.dtd" -- loose DTD
    "frameset.dtd" -- DTD for frameset documents
    "HTMLlat1.ent" -- Latin-1 entities
    "HTMLsymbol.ent" -- Symbol entities
    "HTMLspecial.ent" -- Special entities
    The binding between public identifiers and files can be specified using a catalog file following the format recommended by the Oasis Open Consortium (see [OASISOPEN]). A sample catalog file for HTML 4.01 is included at the beginning of the section on SGML reference information for HTML. The last two letters of the declaration indicate the language of the DTD. For HTML, this is always English ("EN").

    Note. As of the 24 December version of HTML 4.01, the HTML Working Group commits to the following policy:

    Any changes to future HTML 4 DTDs will not invalidate documents that conform to the DTDs of the present specification. The HTML Working Group reserves the right to correct known bugs.
    Software conforming to the DTDs of the present specification may ignore features of future HTML 4 DTDs that it does not recognize.
    This means that in a document type declaration, authors may safely use a system identifier that refers to the latest version of an HTML 4 DTD. Authors may also choose to use a system identifier that refers to a specific (dated) version of an HTML 4 DTD when validation to that particular DTD is required. W3C will make every effort to make archival documents indefinitely available at their original address in their original form.


    So in summary, i don't think it's needed, but it's polite to put it in for browsers, otherwise i think they have to guess the doctype
  6. #4
  7. Founder, SEOChat.com :)
    SEO Chat Skiller (1500 - 1999 posts)

    Join Date
    Dec 2002
    Location
    Florida, Madrid, Berlin, Dublin
    Posts
    1,820
    Rep Power
    526
    Yeah, it's complicated eh?

    I know to use it and I have a general sense of what it does..

    But if you create a new page and visit W3C and try to select a declaration to you, it's rather confusing.

    I remember trying to get one for a frameset once, put it on the page, did a validation check and it gave errors.. Which I though was interesting because it said the declaration type was wrong - even though I had got it directly from their site!
  8. #5
  9. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jan 2003
    Posts
    9
    Rep Power
    0

    Why <!DOCTYPE>s matter


    In addition to their primary function of providing the browser with information on the structure of documents, the &lt;!DOCTYPE&gt; is also used by browsers (in particular Internet Explorer v6.0 and Netscape Navigator v6.0 and higher) to determine how they render a page for compliance with HTML and CSS standards. Older versions of browsers rendered HTML and CSS in non-standard ways, and so the browser makers have begun to use the &lt;!DOCTYPE&gt; declaration to swicth between the so-called "quirks mode" and "standards compliant mode". This is particularly important to webmasters who rely on CSS for positioning elements on their pages because Internet Explorer v.4.0-v5.5 used non-standard methods in many areas. As they move to making their pages comply with the W3C standards, they need to let the browsers know how to render them by using the proper &lt;!DOCTYPE&gt;. For more information see: A List Apart.com, Mozilla.org, and Microsoft Knowledge Base
  10. #6
  11. Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Apr 2003
    Location
    Lancaster
    Posts
    12
    Rep Power
    0
    One of the main problems have come accross regarding DOCTYPE is, if you are using a HTML editor like Dreamweaver, and you set the DOCTYPE that you would like using Dreamweaver, the software will still allow you to insert tags that are not of the DOCTYPE that you set .. with no warning.. you then end up not being able to get your Page validated
  12. #7
  13. No Profile Picture
    Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Feb 2003
    Location
    Planet Earth
    Posts
    193
    Rep Power
    16
    this day in age DOCTYPE is practically pointless! (my opinion)

    all the new clients are intelligent enough to render according to the code, and in many instances render according to expectations from sloppy (frontpage, dreamweaver, wsiwyg etc...) code. thats why Netscape had to give up the idea of sticking with strict standards only rendering and went to a "lazy coder" rendering engine in Gecko. (thank goodness.... Netscape wasn't gonna make the world follow w3c's rules) now maybe Netscape can have a second wind. anyhow that NS stuff is gettin off the subject.

    the point is that DOCTYPE is pointless! (my opinion)

    if u don't use it, u dont suffer. if u use it, use it right; if u don't know how to use it then don't use it. i know how... and i don't use it.

  14. #8
  15. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jan 2003
    Posts
    9
    Rep Power
    0
    How much a DOCTYPE will affect you is certainly dependent on the techniques used for the layout of any given page. So, if you design for IE4 using &lt;table&gt;s as your primary framework, you will not run into many problems. But if you use CSS for layout control and require solid control over the placement of the various elements in your pages, you will run into cross-browser compatibility issues. The most notable of these is the non-standard box model measurement in older versions of Internet Explorer that I mentioned before.

    Now, its true that since MSIE owns over 90% of the browser market at the moment, and you can ignore these issues and not feel any significant impact today. But it is also true that Microsoft is moving towards making MSIE standards compliant, and that means they control the backwards compatibility that you'd be relying on. If they ever decide they need to eliminate the backwards compatibility mode to somehow induce people to upgrade to Windows XP, you're left scrambling. Today, America Online needs the lever of having the Netscape-based client available in order to make Microsoft keep the AOL icon on the Windows desktop. If that deal ever falls apart because, say MSN starts to threaten AOL, you could suddenly face 10-20 million users inexorably upgrading to a standards compliant browser. Then you add non-traditional web-enabled devices like cell phones, video games, etc. which are far more likely to rely on the W3C standards than trying to emulate the bugs in IE4. You may not care about them today, but tomorrow they could be too important to ignore.

    Designing to the W3C standard makes so much sense and takes so little effort that it seems silly to argue against it. It reminds me of today's Non-Sequitur comic strip. Its shows a scene of a man with a steering wheel in his hands standing at the Pearly Gates of Heaven in front of St. Peter who's got a book open and is obviously examining the life of this poor sod. The caption reads: "...which brings us to the point in your life when you adopted that 'seat-belts are for wimps' philosophy..."
  16. #9
  17. No Profile Picture
    Contributing User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jul 2003
    Location
    Australia
    Posts
    43
    Rep Power
    15
    Originally posted by ilili
    all the new clients are intelligent enough to render according to the code, and in many instances render according to expectations from sloppy...code. thats why Netscape had to give up the idea of sticking with strict standards only rendering and went to a "lazy coder" rendering engine in Gecko. (thank goodness.... Netscape wasn't gonna make the world follow w3c's rules)

    Gecko is certainly not a "lazy coder" rendering engine, and it is becoming more and more standards compliant (yes, those W3C standards) as time goes on. As are all the other browsers, including IE. And now that Microsoft has effectively killed off IE as a stand-alone browser, their market share is only going to decrease (which it has been anyway), meaning that standards compliant sites are going to work for more of your visitors, and as rainborick said, will be much more forward-compatible.

    Definitely worth the effort to do - reaching 100% of your audience has to be better than reaching 90%!
  18. #10
  19. No Profile Picture
    Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    May 2003
    Location
    Leeds, England
    Posts
    487
    Rep Power
    16
    So what is the correct DOCTYPE - On my site I have <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    This is generated from the software.

    What would you suggest it to be?
  20. #11
  21. rod@missionop.com
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Mar 2003
    Location
    Palm Beach Gardens FL 33410
    Posts
    16,980
    Rep Power
    0
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> This would be the easiest to conform to leedslad73.

    this day in age DOCTYPE is practically pointless!
    Firmly disagree ilili. All industries must eventually be in compliance with standards, and the web isn't any different.

    www is bearly 10 years old and the book hasn't really been written, let alone adopted but it will come.

    Many think "not" to validate because it isn't easy -- I know of no standards that are easy.

    The other way of looking at this -- try telling all clients/customers that you don't comply with standards because they are pointless...?

    If nothing else, (for the time being)the "bragging rights" that you "do" comply to an approved standard is a competitive advantage that most overlook. ;)
  22. #12
  23. No Profile Picture
    Contributing User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jul 2003
    Location
    Australia
    Posts
    43
    Rep Power
    15
    Originally posted by leedslad73
    So what is the correct DOCTYPE - On my site I have <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    This is generated from the software.

    What would you suggest it to be?
    Most sites are better off at this stage to stick with HTML rather than going to XHTML, unless you particularly need it. For existing pages the Transitional DTD is appropriate:

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

    For new pages you should use Strict:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
  24. #13
  25. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Sep 2003
    Location
    Germany
    Posts
    3
    Rep Power
    0
    Your are using an invalid DTD.

    Look for valid DTDs at the w3c site:
    http://www.w3.org/QA/2002/04/valid-dtd-list.html

    To validate you can use the w3c html validator
    or load a page in Opera browser an press
    Strg + alt +v and the page will be send to the online validator.
  26. #14
  27. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Apr 2004
    Posts
    1
    Rep Power
    0

    The declaration for the entity "HTML.Version" must end with '>'


    Hi,

    I encounter the following error when trying to do xml transformation

    The declaration for the entity "HTML.Version" must end with '>'. I am trying to troubleshoot this way. Guess its to do with the declaration.

    Is it mandatory to declare this way?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "
    http://www.w3.org/TR/html4/loose.dtd">

    or is it ok to declare this way [to avoid the above said error.]

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



    Thanks and regards,

    eswar

  28. #15
  29. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Sep 2003
    Location
    Germany
    Posts
    3
    Rep Power
    0
    It's ok to write declaration in one Line.
    You don't need the cariage return.

    Axel
Page 1 of 2 12 Last
  • Jump to page:

Similar Threads

  1. additional DOCTYPE DECLARATIONS
    By Dinrock in forum Web Design, Coding and Programming
    Replies: 6
    Last Post: Jan 9th, 2007, 11:12 PM
  2. Html 4.0 Transitional
    By madhusudhancr in forum Google Optimization
    Replies: 8
    Last Post: Sep 28th, 2003, 06:20 PM
  3. regarding DOCTYPE declaration to help optimize FP site
    By Dinrock in forum Web Design, Coding and Programming
    Replies: 2
    Last Post: Sep 8th, 2003, 02:23 AM
  4. Replies: 0
    Last Post: Sep 4th, 2003, 08:03 PM

IMN logo majestic logo threadwatch logo seochat tools logo