Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML 4 vs HTML 5 [closed]

I have been reading a lot about HTML 5 and some of the changes that it offers. It seems though that for most of my needs (LOB apps) it really wouldn't have that big of impact. But recently I had a designer friend of mine tell me that I need to start building everything in HTML 5 because that is what everyone is wanting now.

Can someone give me some good articles or point me in the right direction to really understand what HTML 5 offers me vs HTML 4?

like image 912
spinon Avatar asked Feb 27 '23 13:02

spinon


2 Answers

You don't need to start implementing HTML5 all of a sudden. The spec is still in flux, and is not expected to be fully complete for quite some time. Additionally, browser support is not all there yet. That said, there are things you can do today:

  • Use the new doctype, all browsers should support it
  • Structural elements - article, section, nav, etc. I like these because they provide additional semantics over the generic div. Use the HTML5 shiv script for Internet Explorer compatibility. Update your style sheet to give these elements display: block.
  • New form elements. Not fully supported, but are intended to be backwards compatible.
  • audio and video elements - they provide fallbacks for older browsers.
like image 69
Grant Palin Avatar answered Mar 04 '23 17:03

Grant Palin


If you're doing LOB stuff and nothing too fancy graphics-wize, then probably the biggest change would simply be using the HTML5 doctype tag:

<!DOCTYPE html>

Even on browsers that don't support HTML5 directly (e.g. IE7) this is interpreted as a valid DOCTYPE and the browser stays in "standards" mode. So as a starting point, that's probably the simplest you can do.

Then you can start looking at some of the additional attributes and so on that HTML5 brings to the table. Support for HTML5 forms is quite lacking at the moment (mostly it's just Chrome/Safari/WebKit and Opera that supports most of them) but it doesn't hurt adding them (they're backwards compatible).

like image 21
Dean Harding Avatar answered Mar 04 '23 15:03

Dean Harding