SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    UK, Scotland
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi All,

    I am hoping someone might be able to help me explain a little problem I am having with validating my HTML on my site.

    I have been using HTML Tidy and don't fully understand the DTD Doctype Defintion part which goes into the first line of an HTML document.

    This is what I put into the first line. Running through HTML Tidy outputs an error (html doctype doesn't match content).

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

    Yet when I use this one:

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

    Without the Transitional the document seems to conform.

    Can someone tell me if I am using the wrong DTD or perhaps tell me where I am going wrong.

    I would be really grateful for any help on this matter!

    Thanks,

  2. #2
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    w3c

    I can't seem to get onto the site at the moment, but you should find the full answer to your question at www.w3c.org .

    The doctype definition is to do with how compatible your page is with the new xhtml standard, I believe the three main types are strict, loose (transitional) or not at all!

    I could be wrong as I use the DW4 default doctype (terrible I know), but the truth is definatelt on the W3c site.

    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    UK, Scotland
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Document Type Definition

    Hi Again,

    Actually I use Macromedia Dreamweaver 3 so I notice that it doesn't include the DTD so I added it myself. I guess I didn't do it correct.

    Does Dreamweaver 4 include this and if so what is its Doctype?

    Thanks for your help! I have looked at W3C website for finding out what DTD to use but I am still not having much luck on the page as I don't really understand the DTD's.

    I guess my page is just not conforming at all please do excuse my ignorance

  4. #4
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as replied by TheOrginalH, your doctype actually validates html 4.01. not xhtml 1.0

    what is the exact reason given by html tidy? you are using html tidy to tidy up your code? or are you just VALIDATING your code?

    whatver the reason you're doing, make sure youknwo what each doctype represents. based upon what youspecify for the doctype, the various browsers will rener the page based upon that. hence when you validate your page for example, the ultility..say validator at w3c.org will check for errors in your source code.

    based upon that output, go fix up yourcode.

    online validator : http://validator.w3.org/
    doctype explanation : http://www.w3schools.com/html/attr_doctype.asp
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


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
  •