SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 28
  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what would be the best DOCTYPE to use these days?

    is HTML 4.01 version ok and compatible with most browsers?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    HTML 4.01 strict is now fully supported by all modern browsers.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about if I html 4.01 doctype and a user open the document in Internet explorer 5 or 6 or any other browser older versions? will it display or it will be comflicting?

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It will display; in fact I don't think Internet Explorer actually uses a HTML DTD "correctly" anyway? Stephen might be able to clarify whether that is the case nowadays.

  5. #5
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    guys

    I tried to validate my web site in it threw this awful message!


    Sorry! This document can not be checked.

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It is possible your Firewall is blocking things how did you try validation? By Upload, URL or copy-and-paste? I assume it is a text/html HTML file with a .htm extension.

  7. #7
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What was the rest of the error message?

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  8. #8
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @xtmlcoder I have tried by url

    @gary the rest of the message is as below

    Sorry! This document can not be checked.

    1. Error

    Sorry, this type of URL scheme ("") is not supported by this service. Please check that you entered the URL correctly.

    URLs should be in the form: http://validator.w3.org/

    If you entered a valid URL using a scheme that we should support, please let us know as outlined on our Feedback page. Make sure to include the specific URL you would like us to support, and if possible provide a reference to the relevant standards document describing the URL scheme in question.

    Remember that you can always save the page to disk and Validate it using the File Upload interface.

  9. #9
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The index page in the website is index.php

    Does it has to be html format?

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by co.ador View Post
    The index page in the website is index.php

    Does it has to be html format?
    Yes. You have to run the PHP and generate the HTML and then pass that to the validator. The validator doesn't understand PHP.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by co.ador View Post
    What about if I html 4.01 doctype and a user open the document in Internet explorer 5 or 6 or any other browser older versions? will it display or it will be comflicting?
    The full doctype is only used by browsers for switching between quirks and standard mode. Any docytpe will trigger standards mode and so get the browser displaying the page as close to the standards as the browser is capable.

    The doctype itself is only used by validators in order for you to validate whether your HTML complies with a given standard to at least the extent to which the validator is capable of checking (there are some rules the valudator can't check).

    So an HTML 4 strict doctype validates that you only used HTML 4 tags.

    An HTML 4 transitional doctype checks that you used HTML 4 and HTML 3.2 tags

    An HTML 3.2 doctype checks that you used HTML 3.2 tags.

    An HTML 2 doctype checks that you used HTML 2 tags.

    In each case any proprietary tags you use will be reported as an error as will any tags not in that version of HTML.

    If you are not planning on running your code through a validator you may as well use the short version of the doctype <!DOCTYPE html> as that is a valid doctype for all versions of HTML from 2 through 4 and is the only part that the browser needs for its mode switching.

    HTML 5 which is reverting to the HTML 1 days of not being based on SGML and therefore not having an SGML doctype has declared that in that version of HTML the <!DOCTYPE html> tag is an HTML tag used soley for mode switching in browsers. That allows it to continue to be compatible with the way that browsers use that SGML tag in HTML 2 through 4 for mode switching.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  12. #12
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just as in here Where html 1.0 strict don't allow <title> tags..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    Error message that indicates that html 1.0 strict doesn't allow title tags..

    # Error Line 15, Column 7: document type does not allow element "title" here

    <title>www.consejo.com</title>



    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
    I wonder how usefull are the title tags, should I use another doctype for this case that display tittle tags?

  13. #13
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    @gary the rest of the message is as below
    Did you include the "http://" in the URL?
    Simon Pieters

  14. #14
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by co.ador View Post
    just as in here Where html 1.0 strict don't allow <title> tags..
    XHTML 1.0 does allow title tags. It must be somewhere between the <head> and </head> tags.

    The error message you are getting indicates that your title tag is not inside the head tag.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  15. #15
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's what it is...

    Do you have a preference among XHTML 1.0 and xhtml 4.0?

  16. #16
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I tend to use XHTML (purely because I prefer the stricter semantic rules and the leanings towards XML - I like the yellow errors to fix my mistakes) however as felgall will repeat at great length (amongst others), unless you have a reason to use XHTML you should simply use HTML 4.01 instead. Unless you are serving the XHTML as conventional HTML there will be serious browser incompatibilities (IE for instance), and thus it's uses are fairly limited.

  17. #17
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    I tend to use XHTML (purely because I prefer the stricter semantic rules and the leanings towards XML - I like the yellow errors to fix my mistakes) however as felgall will repeat at great length (amongst others), unless you have a reason to use XHTML you should simply use HTML 4.01 instead. Unless you are serving the XHTML as conventional HTML there will be serious browser incompatibilities (IE for instance), and thus it's uses are fairly limited.
    Alex, I use XHTML for the same reason you do - knowing that what I am creating is actually slightly invalid HTML but much preferring the stricter validation rules that make the validator more useful. That's the sort of reason that I consider to be a valid one for using an XHTML doctype while still serving the page as HTML. The reason I don't recommend it to others is that too many people fall into the trap of thinking that because they are using an XHTML doctype that their page is XHTML when it isn't. You need to understand the difference between HTML and XHTML properly before deciding to use an XHTML doctype with HTML pages as otherwise you end up in a worse mess rather than gaining any benefit from it.

    I'd consider using real XHTML except that IE8 and earlier don't support it (not sure about whether they are adding support in IE9).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #18
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Don't hold your breath with regards to IE 9 supporting XHTML served as 'application/xhtml+xml'. There is probably more chance said browser will support the majority of HTML5 first. Out of preference I do serve 'application/xhtml+xml' for those that can accept such MIME.

    Although of course I am wasting my time doing such but it gives me some sick satisfaction when I see Browser; "Yellow Screen of Death".

  19. #19
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    There is probably more chance said browser will support the majority of HTML5 first.
    I wouldn't hold my breath waiting for any browser to support that - we are probably at least ten years away from HTML 5 gets even remotely close to becoming a standard. The only purpose browsers have in including anything from the HTML 5 preliminary draft is so that experimenters can try them out to see which ideas do and don't work. By the time HTML 5 actually becomes a standard it will probably look a lot different from the way it does now.

    The reason I suggested that IE9 might support XHTML is that there has been a lot of talk of their replacing the Trident rendering engine with Gazelle and if they do and Gazelle supports XHTML then IE9 would as well (haven't seen anything as to whether Gazelle does or doesn't support it though and also nothing as to whether they actually are using Gazelle).

    With the timeframes for when XHTML 1.0 and HTML 5 will be final standards (one about 10 years ago and the other in about 10 years time) I would be very surprised if IE15 did not support XHTML even though it still doesn't support the yet to be finalised HTML 5. Assuming Microsoft are still bothering to produce a browser by then and that they still have a big enough market share for it to even matter.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  20. #20
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,072
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The reason I suggested that IE9 might support XHTML is that there has been a lot of talk of their replacing the Trident rendering engine with Gazelle and if they do and Gazelle supports XHTML then IE9 would as well (haven't seen anything as to whether Gazelle does or doesn't support it though and also nothing as to whether they actually are using Gazelle).
    If that does happen that will be good news though I personally would still not bother serving XHTML pages application/xhtml+xml as chances are that a lot of people would be stuck with versions 6-8 of IE (some might not have a choice if in an educational establishment or in the workplace) for a while yet.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  21. #21
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Having written xhtml as an xml application for an intranet, I can tell you it is wondrous powerful. It has all the power of xml and it has the ease of authoring of html. Were MSFT not so obdurate, we would not be worrying over html5 right now beyond extending browser capabilities, e.g. canvas, video, etc., and a lot of css3 properties.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  22. #22
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    is HTML 4.01 version ok and compatible with most browsers?
    http://htmlhelp.com/tools/validator/doctype.html

  23. #23
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by felgall
    Alex, I use XHTML for the same reason you do - knowing that what I am creating is actually slightly invalid HTML but much preferring the stricter validation rules that make the validator more useful.
    Why not write valid HTML with HTML4 strict doctype and tell the validator to check your document as if it were XHTML1 for the desired extra strictness, since that strictness is only valuable in the validator? I do this regularly, to catch typos like unclosed li's or p's.

    Or does the validator miss some things unless you really do have the XHTML doctype?

  24. #24
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    Why not write valid HTML with HTML4 strict doctype and tell the validator to check your document as if it were XHTML1 for the desired extra strictness, since that strictness is only valuable in the validator? I do this regularly, to catch typos like unclosed li's or p's.

    Or does the validator miss some things unless you really do have the XHTML doctype?
    The following short version of the doctype is valid for all versions of HTML between HTML 2 and HTML 4.01 and is the only part of the doctype that browsers actually care about.

    <!DOCTYPE html>

    If you are going to specify anything more in the doctype than that for HTML pages then only the validator is going to use it so it might as well be the value you want the validator to use.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  25. #25
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I really was unhappy when they announced XHTML2 was being abandoned, given time I think it would have become a much more mature and relevant specification than HTML5 as it had a lot going for it. Plus it had some pretty exciting advances in store - unlike the new version of HTML which apart from canvas and video/audio it was mainly hyping about some DIV replacements to give semantic meaning we already achieved (to some extent) using ID "naming patterns".


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
  •