Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Trying to validate my HTML

  1. #1
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default Trying to validate my HTML

    Okay, I am trying t validate my HTML with this. But I can't understand what to do. Like the CSS Validator told you what was wrong and gave you the right way to do it at the bottom but this one isn't doing that and I have no idea what to do. One of the major things is the Doctype. First of all I have no idea what a Doctype or how to add one. I clicked the link to the "how to add a doctype" and I literally copy and pasted the code thing and then revalidated and it gave me 2 new errors! Can someone help me with this and explain it to me in plain English?

    Here is my site.
    ------------------
    Check out my site here and let me know what you think

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Until you learn more about validation, I would try using the HTML 4.01 Transitional doctype instead of the Strict. But yes, you will have more errors show up to start with, because the doctype changes the way your code is interpreted: it tells the browser specifically how to handle it, instead of letting it guess.

    Add this to the very top of your page (removing all other doctypes or doctype parts):
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    You will also need a valid content-type declaration, such as
    Code:
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    in your <head> section (I don't know exactly what character set you're using, but utf-8 is a pretty safe bet).

    Then, revalidate and see what comes up. My advice is to try solving only one error at a time, so you can keep track of what you're doing easier (and don't waste too much time fixing things the wrong way!).

    Good luck!

  3. The Following User Says Thank You to traq For This Useful Post:

    ModernRevolutions (03-03-2009)

  4. #3
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Actually, I would recommend that use use the Strict doctype from the beginning so you will learn it the right way from the start.

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

    Default

    Yes: 'I don't understand what I'm doing, so I'm going to tailor my site to an antiquated DOCTYPE based on the previous version of HTML' is not good thinking.

    Your HTML is really very mangled. I would suggest you start with a good tutorial, but just to get you kick-started, the outline of your document should look like this (<!-- ... --> denotes a comment; these blocks are here for your information only, and you can safely remove them):

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <!-- This is the DOCTYPE, the thing that tells the parser
         what sort of markup we'll be using in this page.
         This is the *only* thing that should be outside the
         <html> element. -->
    
    <html>
      <head>
        <!-- This is the <head> of your document.  Assorted
             data to do with the document that isn't part of the
             actual displayed content will go here. -->
    
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <!-- This specifies that your page should be interpreted
             as UTF-8, a Unicode encoding.  At the moment your
             page doesn't actually validate as UTF-8, but you
             should probably convert it (there will be an option
             in your editor). -->
    
        <title>The title of your Web page</title>
        <!-- This is the title of your Web page.  It will appear
             in the title bar or on the tab in most current
             browsers when accessing your page. -->
    
      </head>
    
      <body>
        <!-- The content of your page goes here, but don't put
             text directly here: it needs to be wrapped in block
             elements like <p> or <div>.  How you organise
             your content depends on what it is.
             Generally you will have a few <div>s that divide
             the page up into things like title, navigation,
             content, and footer, and then <p>s within the content
             section to denote paragraphs; for the navigation,
             one or more <ul>s is usually the best course. -->
      </body>
    </html>
    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!

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

    ModernRevolutions (03-03-2009)

  7. #5
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    Okay, so I added the main tages, (head, html, doctype, and body) is there anything MAJORLY wrong with my HTML what is a MUST fix? If so what, and how would I go about fixing it? Thanks to all who have posted
    ------------------
    Check out my site here and let me know what you think

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

    Default

    Yes: every one of these forty-four errors. It's a total mess. It doesn't even begin to make sense. It's the HTML equivalent of the English sentence 'green wub hummed flinger Johnny elephant'. I would suggest going through the tutorial and then doing a total rewrite.
    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. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    You can use http://validator.aborla.net/ to help you correct errors.
    ===
    Arie.

  10. #8
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by Twey View Post
    Yes: 'I don't understand what I'm doing, so I'm going to tailor my site to an antiquated DOCTYPE based on the previous version of HTML' is not good thinking.
    I think the question about which doctype is 'allowed' is less important than knowing exactly what doctypes do, and why you want to use one doctype rather than another (of the basic three). If you cannot drive a Mercedez, then use a bike. The important thing is to be able to use the means of transport enabling you to get where you want to be. (But, eventually, the bike may prove too slow, or may prove to lack certain fundamental things). Anyhow, validation shouldn't be a goal in itself, but merely a means to be sure that your site will show correctly on any browser. If you could find a way to be sure about that without the validation-requirement, it would be fine.
    ===
    Arie.

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

    Default

    On any browser, present or future — practically speaking, that means it has to be standards-compliant to a modern level. That's the reason standards exist.

    Transitional DTDs are not modernly compliant. They are based on the old HTML3 DTD, and were never intended to be used as anything other than a stop-gap measure to ease the transition from HTML3 to HTML4 or XHTML1 (hence the name). That was over a decade ago now, meaning that the Transitional DTDs are effectively more than ten years out of date. Nobody writes HTML3 any more, so why do people still use HTML4?
    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!

  12. #10
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by molendijk View Post
    If you cannot drive a Mercedez, then use a bike.
    More like "if you don't want to learn how to drive a car, use a 19th century steam engine powered automobile and watch all modern vehicles overtake you and when flying cars became popular, start learning how to drive a car"

    * The flying cars in this confusing metaphor would be HTML5

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
  •