XHTML strict / HTML5??

Discussion in 'Web Design and Development' started by Dal123, May 13, 2012.

  1. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #1
    Been a couple of years since I done a website, and I've only done two in my time.
    Should I use xhtml strict or html5?
     
  2. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #2
    html5, without a doubt. XHTML has always been dead in the water.
     
  3. YanniDepp macrumors 6502

    YanniDepp

    Joined:
    Dec 10, 2008
    #3
    ... unless you're the kind of developer who actually cares about things like page semantics, progressive enhancement and so on. XHTML 1 has been very useful in writing structured page content, and major browsers support it because it can be read by a standard HTML parser (with stricter rules). There's a new version of XHTML called XHTML 5, and it won't catch on because it's structurally very different to HTML and browser manufacturers would have to maintain another renderer to support it.

    As for the original guy's question, if you're writing well-formed content (closing your tags etc.) the only practical difference between writing HTML5 and XHTML is the doctype. HTML5 lets you write your pages in a well-formed XHTML way, or the old-school HTML way. if you want to self close your <img /> tags, go ahead. If you don't want to, you can do that with HTML5 too.

    The difference is a lot less than you'd think because a lot of browsers don't actually care what your doctype is - they just care that you have one. IE, for example, renders your page in Standards Mode if it has a doctype and Quirks Mode if there isn't a doctype - it doesn't give a crap which doctype you have. I know Opera and Firefox behaves in similar ways (but not nearly as much as IE does). That's part of the reason that HTML5's doctype is just <!doctype html>.

    So, in summary, if you want to close your tags and make sure your page is well formed, it doesn't matter which you use. I use HTML5 because <!doctype html> is easier to remember.
     
  4. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #4
    Sorry, but you're barking up a TREMENDOUSLY wrong tree here. XHTML never caught on because it was always a bad idea. And page semantics, progressive enhancement, etc are total red herrings, because they're possible in ANY doctype. HTML4 transitional supported all of that, so not sure what you're talking about.

    [/QUOTE]
     
  5. NutsNGum macrumors 68030

    NutsNGum

    Joined:
    Jul 30, 2010
    Location:
    Glasgow, Scotland
    #5
    That was XHTML2 but it got canned around 2 years ago.
     
  6. MikeTheVike macrumors regular

    Joined:
    Aug 8, 2009
    #6
    XHTML Strict doctype was a lot better than any transitional doctype, especially when it came to IE browser rendering bugs.

    And to the thread starter, HTML5 is fine to use.
     
  7. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #7
    "Better", in that if you sent it as application/xhtml+xml, as the spec defined it, it rendered as source code in IE? Or "better", in that if you relented and sent it as text/html, the browser engine treated it as plain HTML?
     
  8. Dal123 thread starter macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #8
    Thanks for replies people :D. I think I'll stick with xhtml as I am familiar with it and it shows up pretty well on browsers that I have tested. Especially on mobiles where I thought I would have problems.
     
  9. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #9
    Really? Why even ask the question if you're just going to go against the recommendations?
     
  10. Dal123 thread starter macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #10
    I'm taking MiketheVike, and YaniDepp's input and before you start I know Mike said HTML5 is fine to use; no one is really screaming to use HTML5.

    It seems that xhtml is still perfectly valid and has good cross-browser compatibility. No-one has made a case for HTML5 really, I was expecting more HTML5 support :eek:.


    'Sorry, but you're barking up a TREMENDOUSLY wrong tree here. XHTML never caught on because it was always a bad idea. And page semantics, progressive enhancement, etc are total red herrings, because they're possible in ANY doctype. HTML4 transitional supported all of that, so not sure what you're talking about.'
    Don't really see what point you're trying to make here??? Maybe that xhtml requires perfect semantics or something.
     
  11. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #11
    HTML5 is supported by all browsers. Why would you build something using an old format when there's a new format that replaced it?

    The point I was making is that none of those things are found only in XHTML. All of those points (page semantics, progressive enhancements) are present in ALL flavors of (X)HTML. As I've said before, XHTML always was a bad idea, and now it's an out-of-date, bad idea. If you use it the way it's supposed to be used (serving it as XML), IE doesn't work at all, and _all_ browsers have issues rendering it. If you serve it as text, there's absolutely no reason to use XHTML, as it's parsed using the HTML engine in-browser.
     
  12. Dal123 thread starter macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #12
    Now you're making some good points :) and I'm thinking of doing it in html5.
    I Just hope it's not gonna be too bad to learn as I'm an absolute amateur :eek:.
    Thanks for replies.
     
  13. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #13
    HTML5 is quite easy to pick up, especially if you know XHTML already. HTML 5 supports either HTML4-style or XHTML-style tags (e.g., <img> or <img />), and the doctype is extremely easy to implement. You get the added advantage of a lot of new semantic elements, but you don't have to use any of them, you can just stick with the older elements until you get more comfortable.
     
  14. clemsonhomerun macrumors newbie

    Joined:
    Jul 11, 2009
    #14
    Doesnt IE deliver everything in Quirks mode....if not the "Im the worst browser ever and let me show you" mode...?
     

Share This Page