SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 48 of 48
  1. #26
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Max Height View Post
    For me, who likes the rigidity of xhtml, the fact the w3c validator passes the above code is a deal breaker for using the above doctype unless ...
    Which is perfectly fair enough. For me, because I never am likely to leave elements unclosed etc. that doesn't bother me. I'm more liley to make a typo, which the validator would pick up.

  2. #27
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Which is perfectly fair enough. For me, because I never am likely to leave elements unclosed etc. that doesn't bother me. I'm more liley to make a typo, which the validator would pick up.
    I'm also unlikely to leave elements unclosed, especially since my IDE (netbeans) automatically inserts the closing tag when I type in the opening tag. But if someone is using just a basic text editor they are much more likely to have unclosed tags and if they use <!DOCTYPE HTML> and see it passing the w3c validator (with unclosed tags and possibly other undetected errors) they then often wander into forums like this one in tears and with their code dragging along the ground behind them and ask "Why isn't my page working in such 'n such browser?"

    If someone insists on using <!DOCTYPE HTML> for html4 or xhtml docs, I am not going to say they must not use it, but I think we (colectively) should at least point out the potential pit falls and not necessarily given them carte-blanche to use <!DOCTYPE HTML> in all documents.

  3. #28
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Max Height View Post
    they then often wander into forums like this one in tears and with their code dragging along the ground behind them and ask "Why isn't my page working in such 'n such browser?"
    Usually the doctype they are using is the least of their worries. Many have never heard of a validator anyway, or a strict doctype.

  4. #29
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Usually the doctype they are using is the least of their worries....
    Not necessarily.

    The point I was making is that if they didn't use <!DOCTYPE HTML> when they didn't have to and instead used a more appropriate doctype for their web page, the validator would have picked up the error and they, in many cases, would then fix the problem straight away rather than spend time going to a forum asking for help on why their page doesn't work even though it passed the validator and so not giving them a reason to look closer at their code for the cause of the problems.

  5. #30
    SitePoint Member hosterduke's Avatar
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great information - thank you. I still don't have the solution however. <!DOCTYPE HTML> does not work for my site.

    The only doctype I can find that works is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    This is an older site FYI. Not a newly created one.

  6. #31
    SitePoint Member hosterduke's Avatar
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cranial-bore View Post
    HTML Code:
    <!DOCTYPE html>
    Beautifully simple isn't it?
    Should I assume this character encoding along with it? content-type: text/html; charset=ISO-8859-1

  7. #32
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The <!DOCTYPE html> option was first introduced in HTML 2. The only difference when you use that rather than the longer version with HTML 2, 3.2 or 4 is that you are not specifying which version of SGML compliant HTML that you are using. It is simply the short version of the SGML tag identifying the content of the file as HTML. With HTML 5 they have dumpled the markup standards from SGML and added that tag into HTML itself. So you can either use a standards compliant version of HTML with that tag or a more recent version of HTML that doesn't bother with following the standards and use the same tag even though it means something completely different.

    Presumably once HTML 5 becomes a standard (if it ever does given that almost everyone is still using HTML 3.2) they will then change the doctype so as to distinguish between pages that follow the finished standard from those that follow something from the draft version that doesn't end up in the final standard. After all It was the IE5 implementation of the box model from an early draft of CSS2 that led to browsers having to check for the doctype tag in the first place in order to distinguish between pages written to follow that early draft from pages written to follow the completely different final standard.

    The HTML standards have nothing to do with the <!DOCTYPE html> tag except for HTML 5 where it is defined as a part of the HTML. Wikipedia has a reasonably accurate description of SGML at http://en.wikipedia.org/wiki/Standar...arkup_Language where you can find out what the doctype tag really means for all documents that are not HTML 5.
    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="^$">

  8. #33
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Thanks felgall. Could you explain a bit more about what this means:

    Quote Originally Posted by felgall View Post
    With HTML 5 they have dumped the markup standards from SGML and added that tag into HTML itself.
    In what way have they dumped standards? Do you mean various elements now have different rules, or something more fundamental?

    Also not quite sure what adding the tag to the HTML means.

    Will try to go through that WikiPedia article, but I think I've looked through it before. All this stuff seems like Double Dutch to me.

  9. #34
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    In what way have they dumped standards?
    There is a standard for defining markup languages that is called SGML. All of the versions of HTML between 2 and 4.01 have been defined using that standard - hence they are allowed to have an SGML doctype at the top of the document that defines just what type of document they are. The optional parts of the doctype include having a link to the definiition of the markup language - for example http://www.w3.org/TR/html4/strict.dtd is the definition according to the SGML standards of HTML 4 strict. Now if the browsers were going to use the doctype properly they'd use that file as the definition of what tags and attributes that the language allows and would refuse to display any page that contained something non-standard - none of the browsers actually work that way though as some that are still in use were originally created before HTML2 and HTML 1 didn't follow the standards - the other browsers need to be as forgiving of garbage in order to compete. One of the biggest changes in HTML 2 was to redefine HTML in accordance with the SGML standards. One of the biggest changes in HTML 5 was the decision that since the browsers ignore the true meaning of the doctype and only use it as a switch for pages that followed draft versions of standards that they would abandon defining HTML 5 in accordance with the standards and just provide something that looks like the SGML standards definition at the top in its place to use as the switch - of course since HTML 5 is still in draft they'll need another switch to handle the difference between the current draft and whatever comes next - obviously not a standard since HTML 5 isn't bothering with standards.
    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="^$">

  10. #35
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Thanks Stephen. Interesting anwser, as always. I don't see why another switch will be needed later, though. Doesn't that simpler doctype cover all versions?

  11. #36
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,222
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by hosterduke View Post
    Great information - thank you. I still don't have the solution however. <!DOCTYPE HTML> does not work for my site.

    The only doctype I can find that works is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    This is an older site FYI. Not a newly created one.
    That's because your site is XHTML transitional. Transitional because you mix strucuture and presentation... XHTML because empty tags such as link, or img are closed with />

    Exmaple of image in any version of html:

    Code:
    <img src="whatever.jpg" alt="alternative text">
    but in XHTML,
    Code:
    <img src="whatever.jpg" alt="alternative text" />

  12. #37
    SitePoint Member hosterduke's Avatar
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks molona,
    Is my site fine leaving it this way then?

    Quote Originally Posted by molona View Post
    That's because your site is XHTML transitional. Transitional because you mix strucuture and presentation... XHTML because empty tags such as link, or img are closed with />

    Exmaple of image in any version of html:

    Code:
    <img src="whatever.jpg" alt="alternative text">
    but in XHTML,
    Code:
    <img src="whatever.jpg" alt="alternative text" />

  13. #38
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,222
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by hosterduke View Post
    Thanks molona,
    Is my site fine leaving it this way then?
    If you're not going to change the code to make it more appropriate to today's standards, yes, it is fine to leave it like that.

  14. #39
    SitePoint Member hosterduke's Avatar
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am a newbie - anxiously learning but not quite at the point of being able to change this code appropriately. I am working on it though!

    At least I did learn a lot from this forum including to change my title tag (learned it was way to long) and that meta keywords are ignored.

    Your time and knowledge is most appreciated. Thank you.

    Quote Originally Posted by molona View Post
    If you're not going to change the code to make it more appropriate to today's standards, yes, it is fine to leave it like that.

  15. #40
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Thanks Stephen. Interesting anwser, as always. I don't see why another switch will be needed later, though. Doesn't that simpler doctype cover all versions?
    That doctype doesn't allow browsers to distinguish between pages written following the current draft version of HTML 5 from those following the final standard where some of the tags will likely end up meaning something completely different.

    It has happened before where IE5 implemented some CSS 2 while it was still a draft and the final version was different - that's why browsers since then use the presence or absence of the doctype as a switch in the first place.
    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="^$">

  16. #41
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by felgall View Post
    That doctype doesn't allow browsers to distinguish between pages written following the current draft version of HTML 5 from those following the final standard where some of the tags will likely end up meaning something completely different.
    Ha ha, too bad. I'm glad that they don't seem to be planning to change the doctype. Let those who are prematurely using HTML5 go back and fix their sites!

  17. #42
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Ha ha, too bad. I'm glad that they don't seem to be planning to change the doctype. Let those who are prematurely using HTML5 go back and fix their sites!
    yep agree

    lots of people just put their hands over their ears and go la-la-la-la-laaaahhhh when you tell them the potential pitfalls of using html5 atm because they just don't want to hear it, let alone believe it.

  18. #43
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    The sites currently using HTML5 rely heavily on JS anyway, so maybe there will be future JS updates to provide life support for those sites using early versions of the spec.

  19. #44
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    The sites currently using HTML5 rely heavily on JS anyway,
    Perhaps the strangest aspect of it being that most of them are using JavaScript the way it used to be written back in the 20th Century - I guess 15 year old JavaScript combined with HTML that probably has about another 15 years to go before it becomes a standard effectively balance each other out to produce something that on average is current.
    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. #45
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by felgall View Post
    effectively balance each other out to produce something that on average is current.
    Ha ha, sounds like some kind of zombie creature—a mixture of dead ancestors with the yet unborn. Weird.

  21. #46
    SitePoint Member
    Join Date
    Dec 2011
    Location
    Rochdale, UK / Paris, FR
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Who cares about W3C Validator, HTML5 Is awesome!!!

  22. #47
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nikitamathilda View Post
    HTML5 Is awesome!!!
    maybe it is but that is a matter of opinion.

    But since html5 is not even finalised and won't be for quite a few years yet, pages with html5 elements in them today will very likely break if/when html5 is ever finalised because the final version of html5 will be different to the current "in development" version of html5.

  23. #48
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by nikitamathilda View Post
    Who cares about W3C Validator, HTML5 Is awesome!!!
    No not SOME - FULL.
    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="^$">


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
  •