Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Which doctype, please?

    Hello

    I am trying out the validator.w3.org against a page I have on line and I get, among other errors, the following:

    Mismatch between Public and System identifiers in the DOCTYPE declaration

    from this recommended list http://www.w3.org/QA/2002/04/valid-dtd-list.html

    which DOCTYPE should I be using. These Web pages will not be going online; my main concern is that they are compatble in Safari, IE6, 7, and maybe 8.

    One or two of the 'errors' seem plainly wrong. For example, I haven't closed my head tags (when I have), haven't closed the html tags (when I have).

    The page I have is here: http://stevehigham59.7host.com/ImageTest/page1Test.html

    and it is clear that I cannot see the JavaScript images at the top of the page - nor is the text formatted using the style sheet I have (on my desktop I can see the images and text correctly formatted).

    Thanks for any ideas.

    Steve

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,638
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    OK, read the doctype error message agein:
    This document uses an inconsistent DOCTYPE declaration. The Public Identifier -//W3C//DTD XHTML 1.1//EN declares the XHTML 1.1 document type, but the associated System Identifier http://www.w3.org/TR/xhtml11 does not match this document type.

    The recommended System Identifier for XHTML 1.1 is http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd.
    But before you’re going to correct this I’ll have to say: If you define your document as XHTML 1.1 then you must not set the MIME type of the document to text/html, it must be of type “application xhtml+xml”. However, Internet Explorer isn’t capable of parsing XML or XHTML for that matter so you need to send your documents as text/html which is only allowed in HTML and tolerated in XHTML 1.0.

    So, to cut a long story short: Since you are already using XHTML type markup use an XHTML 1.0 strict doctype. Maybe the errors will be gone once the validator knows what kind of language you are using.

    And as to styles and images: look at the file paths. My browser says it can’t find, for example, http://stevehigham59.7host.com/_common/css/main.css (as you have defined in your document).

  • Users who have thanked VIPStephan for this post:

    SteveH (06-03-2009)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello Stephan

    Thanks for your message.

    I'll save your post because the DOCTYPES I have always found confusing - it never used to be like this!

    Regarding the link I posted, the files work perfectly on my desktop in IE, FF, and Safari - the reason they don't work on a server is because they are seeking higher permissions.

    Many thanks again.

    Steve

  • #4
    Regular Coder jamesicus's Avatar
    Join Date
    Oct 2008
    Posts
    106
    Thanks
    0
    Thanked 11 Times in 10 Posts
    Another excellent reference -- including a section on choosing Doctypes : Activating Browser Modes with Doctype

    James
    Web Developer Tool Kit - for creating Standards compliant and Interoperable web pages
    W3C Markup Validation Service - validate HTML code for reliable rendering in all Browsers
    WAVE accessibility evaluation tool - check page structure, image alt text, form labels, etc.

  • Users who have thanked jamesicus for this post:

    SteveH (06-03-2009)


  •  

    Posting Permissions

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