Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: DOCTYPE -- Grr!

  1. #1
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default DOCTYPE -- Grr!

    I have never had a problem with html, but this won't work and it's making me really really really mad!
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
        <html>
    <head>
    </head>
    <body>
        <!-- this shows up as nothing//-->
        <div style="height:100%;width:100%;background-color:#123456;"></div>
    </body>
        </html>
    The problem seems to be the doc type, which w3c requires for valid html. What can a guy do? I tried other DOCTYPEs as well, but the only ones that work are invalid. I am really confused and frustrated.
    Last edited by Jas; 02-24-2008 at 12:23 AM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    you need title tag, even if it is empty:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <!-- this shows up as nothing//-->
    <div style="height:100%;width:100%;background-color:#123456;"></div>
    </body>
    </html>
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  3. #3
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
        <html>
    <head>
        <title>Hello World!</title>
    </head>
    <body>
        <!-- this shows up as nothing//-->
        <div style="height:100%;width:100%;background-color:#123456;"></div>
    </body>
        </html>
    Still does not work. I don't get it. In FF, nothing shows up at all, in IE, the demensions are default. It's like the hieght and width don't exist.

    If you take out the DOCTYPE, it suddenly works. What is going on?!
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I don't think that this will work but try it anyways:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
        <html>
    <head>
        <title>Hello World!</title>
    </head>
    <body>
        <!-- this shows up as nothing//-->
        <div style="height:100%;width:100%;background-color:#123456;"></div>
    </body>
        </html>
    Jeremy | jfein.net

  5. #5
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Good eye, but no, it didn't work. Try pasting it into an HTML file. It's really strange.

    Is it just my computer?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I think so, because I tried both of 'em
    and it works perfectly.
    Jeremy | jfein.net

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sometimes having content will change whether or not something displays (ie add &nbsp; to the div), and also that color isn't valid-- it must be in the form of AABBCC where A, B, and C are values from 0-F (0-9,A-F). It usually works, but technically the web is only meant to have 256 colors (which are determined by what I just said).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The 100% height will be ignored, because you don't have an explicit height for the parent element. You also need 100% height on the <body> and the <html>. It's bad practice to use inline styles.
    that color isn't valid-- it must be in the form of AABBCC where A, B, and C are values from 0-F (0-9,A-F).
    It's perfectly valid, and also includes the mandatory # you forgot to mention. Note that that's only one colour form -- there are others, like rgb(255, 255, 255) (equivalent to #FFF) or #FFF (equivalent to #FFFFFF).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. The Following User Says Thank You to Twey For This Useful Post:

    Jas (02-24-2008)

  10. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, maybe it's valid then, I'm not sure, but it isn't technically supported by all systems, though that may be outdated. Anyway, seems the problem was found.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  11. #10
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Quote Originally Posted by Nile View Post
    I think so, because I tried both of 'em
    and it works perfectly.
    Are you sure it did what it was suppose to?

    Quote Originally Posted by Twey View Post
    The 100% height will be ignored, because you don't have an explicit height for the parent element. You also need 100% height on the <body> and the <html>.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
        <html>
    <head>
        <title>Hello World!</title>
    </head>
    <body style="height:100%;">
        <!-- this shows up as nothing//-->
        <div style="height:100%;width:100%;background-color:#123456;"></div>
    </body>
        </html>
    Did not work. What should I do to get the effect I am obviously seeking?

    Edit: NVM! Twey you rock! I added the height to the HTML tag and it works!


    And DJR33, what is wrong with the color?
    AA | BB | CC
    12 | 34 | 56
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

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
  •