Results 1 to 14 of 14
  1. #1
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    I have a folder with various HTM files.

    Some have

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

    as a first line, others do not.

    The initial lines of either files are

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

    or just

    <html>
    <head>

    at the top.

    That one line seems to not be necessary. If it is not then why is it there? If it is necessary, why is it not in the other page?

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  2. #2
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,594
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    See Wikipedia - Document Type Declaration for a discussion.

    Joe
    Joe

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by CWBillow View Post
    Some have

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

    as a first line, others do not.
    Here's a reference regarding how Firefox responds to document type declarations: Mozilla's Quirks Mode - MDC.

  4. #4
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by jscher2000 View Post
    Here's a reference regarding how Firefox responds to document type declarations: Mozilla's Quirks Mode - MDC.
    Jefferson / Joe, from what I can gather, DOCTYPE is an intruction used just to make sure the browser understands what mode or version set is used -- if everything is "in order", it is unnecessary.

    Yes?

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  5. #5
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,594
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    It may not be required but that does not mean it is unnecessary. If it is missing each browser is going to assume a certain level of functionality. If you use something beyond that level you page will not render correctly.

    Joe
    Joe

  6. #6
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by JoeP View Post
    It may not be required but that does not mean it is unnecessary. If it is missing each browser is going to assume a certain level of functionality. If you use something beyond that level you page will not render correctly.

    Joe
    Joe, so I went to my homepage, MSNBC, and the souce reveals, apparently, no DOCTYPE statement there at all.


    H-m-m-m-m.

    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by CWBillow View Post
    Jefferson / Joe, from what I can gather, DOCTYPE is an intruction used just to make sure the browser understands what mode or version set is used -- if everything is "in order", it is unnecessary.
    Using a Standards mode improves similarity across browsers, but requires more careful authoring and possibly using newer tools. Using Quirks mode increases differences in the way that browsers interpret the same HTML and CSS, which may be frustrating if you are trying for pixel perfection. Use the one that gets you the result you want.

  8. #8
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by jscher2000 View Post
    Using a Standards mode improves similarity across browsers, but requires more careful authoring and possibly using newer tools. Using Quirks mode increases differences in the way that browsers interpret the same HTML and CSS, which may be frustrating if you are trying for pixel perfection. Use the one that gets you the result you want.
    So that would tend to make one think that Quirks is a little more "down and dirty", but still used jut the same.


    Regards,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  9. #9
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,594
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    Quote Originally Posted by CWBillow View Post
    So that would tend to make one think that Quirks is a little more "down and dirty", but still used jut the same.
    No. Quirks mode means the web page is using a feature not all browsers support or using an obsolete feature. If you are creating a web site that conforms to current standards you don't want to use quirks mode.

    Joe
    Joe

  10. #10
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by JoeP View Post
    No. Quirks mode means the web page is using a feature not all browsers support or using an obsolete feature. If you are creating a web site that conforms to current standards you don't want to use quirks mode.

    Joe
    Ah, I see. Thanks Joe.



    Regards,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  11. #11
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Chuck,

    Using the proper DTD allows you to effectively use the HTML Validator to check your HTML for errors. This will help insure the best possible display of your web pages on all browsers.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  12. #12
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by RetiredGeek View Post
    Chuck,

    Using the proper DTD allows you to effectively use the HTML Validator to check your HTML for errors. This will help insure the best possible display of your web pages on all browsers.

    So HTML v Won't work properly without a DTD?


    Ah - hah...


    Thanks,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  13. #13
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,594
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    Quote Originally Posted by CWBillow View Post
    So HTML v Won't work properly without a DTD?
    HTML will work. He was talking about a tool called HTML Validator which is used to do what the name implies - validate your HTML. If you don't use a DTD then the validator does not know what version of the rules to check your code against.

    Joe
    Joe

  14. #14
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by JoeP View Post
    HTML will work. He was talking about a tool called HTML Validator which is used to do what the name implies - validate your HTML. If you don't use a DTD then the validator does not know what version of the rules to check your code against.

    Joe

    Ah...thanks.

    Regards,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •