SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Using HTML5 - Safe or not?

    Hi guys,

    Basically, I'm considering starting to use HTML5 markup soon and I was wondering if there's any downside for users of older browsers. For example, if I'm using the <header>, <section>, <article>, <nav> and <footer> elements, will they fall back to emulating <div> on an older browser, or will they just fail miserably? I don't see a whole lot of point in using them unless there's adequate support, and a quick Google isn't really giving me the answers I'm looking for.

    Cheers

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Antnee View Post
    Hi guys,

    Basically, I'm considering starting to use HTML5 markup soon and I was wondering if there's any downside for users of older browsers. For example, if I'm using the <header>, <section>, <article>, <nav> and <footer> elements, will they fall back to emulating <div> on an older browser, or will they just fail miserably? I don't see a whole lot of point in using them unless there's adequate support, and a quick Google isn't really giving me the answers I'm looking for.

    Cheers
    Older browsers treat all unrecognised thags as the equivalent of <span> so if you want them to be treated as <div> you'd need to define them with display:block in the CSS.
    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 Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That's all I needed to know. Thanks

  4. #4
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not touching html5 or css3 for commercial work until they become "officially released" recommendations from the w3c and after that only after they are at least close to fully supported by the major browsers.

    until then, especially with browser manufacturers being able to doing their own thing, using htnl5 and css3 could be more problematic than it's worth imho.

  5. #5
    SitePoint Evangelist Karpie's Avatar
    Join Date
    Jul 2007
    Location
    Perth, Australia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use some CSS3 selectors, for things like border-radius, RGBA (with fallback), box-shadow, etc. If they aren't implemented by the browser, it's not a huge deal.

    The rest, or anything HTML5, I won't touch.

  6. #6
    SitePoint Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, if you want to use HTML5 in IE <9, you'll need to use Remy Sharp's HTML5 Shiv : http://code.google.com/p/html5shiv/.

    IE won't honour your HTML5 elements unless there's some JavaScript tinkering first - Remy's shiv will do this for you; just place it in the <head> and away you go.

    Of course, users without JS enabled will simply see a horrible mess as all your new block-level elements won't render correctly. For me that's the biggest roadblock to HTML5.

  7. #7
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As kma said you won't be able to style those new elements in IE unless the JS runs first.

    I haven't heard anyone else doing this, but you could have a server side script change the new attributes back to <div> (with a class name) for browsers that don't support them. That way things would work for IE users with JavaScript disabled too.
    In PHP you'd probably use object buffering to modify your markup before it's output.

  8. #8
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It all just sounds like too much of a ball-ache to me. HTML5 can wait

  9. #9
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I work for a large retailer and we are already using HTML 5 with success (started using it around January). Getting started is as simple as changing your doctype (you can continue to write valid HTML 4 markup instead of using the semantic tags). This site has excellent info on what HTML 5 is and the challenges/workarounds related to using it: http://diveintohtml5.org/. By changing your doctype, you have the option to progressively enhance your site with the new features. For example, we don't use the semantic tags at work but we are starting to use the Geolocation API.

  10. #10
    SitePoint Member
    Join Date
    Jul 2010
    Location
    Bolton - UK
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't really see why anyone who is starting a new website wouldn't use HTML5 and CSS3. As Alex said it provides progressive enhancement. Fair enough if you don't want to use the new elements (header, footer etc - though I personally do) but future proofing your site is a good benefit to have.

    Such as all the extra input types. If the browser supports it then you have the new input type else it's just text. So you lose absolutely nothing by using it. And it means you don't have to incorporate any messy javascript alternatives.

  11. #11
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I do like the sound of the date and time inputs, placeholder text and autofocus, but it's all stuff that we can do with JS now and we'll still need to validate it at server-side. I've just had a look at some examples using Chrome and it fails miserably with a lot of fields, so I'm not entirely convinced that there's any point at all. it seems that Opera may be the only browser that supports any of these inputs properly. However, some virtual keyboards like on iOS appear to detect the type and give you the appropriate layout, which is nice. Not nice enough to convince me though

  12. #12
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Rjs37 View Post
    I don't really see why anyone who is starting a new website wouldn't use HTML5 and CSS3.
    Perhaps because they are still in draft and will probably change a lot before they are finished.

    The last time this happened was when IE5 started supporting some of the CSS 2.0 draft and then the released standard was different - that's where quirks mode originated as quirks mode was the way the draft read at the time Microsoft first implemented it. So you could consider the current HTML 5 draft as a new variant on quirks mode rather than necessarily being what will end up in the new standard.
    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="^$">

  13. #13
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm normally the most pro-html5 person around and I say use the new doctype and new input types (it doesn't matter if the new doctypes change in the future - it'll just become a text type instead), but I'd say wait a few years for the new elements - IE doesn't understand them and using javascript makes me feel uncomfortable...

  14. #14
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,213
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by clairs View Post
    I'd say wait a few years for the new elements - IE doesn't understand them and using javascript makes me feel uncomfortable...
    Hear hear. I don't get why so many people, even standardistas, are building sites that depend on JavaScript. And as felgall says, we could easily be heading for another generation of quirks, which is truly frightening.

  15. #15
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I'll say something about the new input types and the "we still have to validate on the server side"... you ALWAYS had to validate on the server side, this isn't extra work of any sort. The possible benefit of the new inputs is, it may help steer users into inputting the correct info or type of info in the FIRST time, rather than them submitting and getting an error message. I can get behind the idea that inputs expecting a very limited type of data can be semantic and therefore more specific tags in the markup can make sense.

    One reason I would NOT use HTML5 (and I don't mean the doctype on top of HTML4) is the way screen readers are fumbling with the new elements. Sometimes it's the fault of the reader. Sometimes it's the fault of the browser. None of the browsers have implemented their accessibility to deal with HTML5, even the browsers who are claiming to "support HTML5". There is a whole layer of additional information browsers send to any (possible) accessibility software that may be interacting with the browser or the computer's windowing system and that needs to be built for all these new elements and attributes. Understandably, AT vendors are being slow and cautious since, as Felgall pointed out, this stuff is still in DRAFT. Things that are very unlikely to change such as <header> tags are getting addressed by browsers and AT but stuff like the "required" attribute in form controls or how to deal with the <canvas> tag's API are still not done and won't be any time soon.

    Here's just an example of the kind of stuff going on out there. Yay, JAWS 12 works! Oh noes, you have to sell your grandson to afford the upgrade from JAWS 10! That kind of thing.

    If you are building a site that must pass some level of WCAG or section 508 or that new ammendment they want to add to the ADA or a commercial site in any of the countries that have started making demands on that sort of thing, you will probably want to stick to HTML4/XHTML until things settle down.

  16. #16
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    I'll say something about the new input types and the "we still have to validate on the server side"... you ALWAYS had to validate on the server side, this isn't extra work of any sort.
    I agree completely, I hope you didn't misunderstand my earlier statement

  17. #17
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I agree completely, I hope you didn't misunderstand my earlier statement
    No, just wanted to emphasise it. For everyone who just points out that the new HTML stuff can't replace server-side validation, there are others wondering if they have to do something extra (I guess if they haven't been validating or relying on Javascript, yeah, they do! : )

  18. #18
    Non-Member
    Join Date
    Aug 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not using html5 because in developing large size html5 applications there is a lack of good productive tooling and it has a limited support for media formats.


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
  •