Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Just about to start building a new site should I use html5 or stick with xhtml?

Featured Replies

I built my last sites using xhtml and they worked out fine but I haven't done anything for a few months now and am wondering should I now be looking to build any new sites in html5. The site I am going to build will be a website for an independent financial advisor with some tutorials similar to this one I did recently.

 

Are there any drawbacks to using html5 and is it an easy transition from xhtml to html5?

 

Cheers folks,

 

Jason

Depends on which features you want to use. Some are widespread enough, you can use them now.

 

Others are a little trickier. However, lack of browser support for a feature doesn't mean you can't use it. Take the placeholder for example. It won't work in IE, but a very simply, lightweight JavaScript, coupled with Modernizr, replicates it in IE.

 

In other words, yes, start using it now. Start gradually introducing HTML features into your code. Replace your div=header with just header, etc etc. Just make sure that to cover your bases with browser compatibility, that you use the relevant shims/shivs/polyfills that you need.

 

I actually wrote a short little article on polyfills, might come in useful: http://michaelgunner.co.uk/using-polyfills-to-replicate-html5css3-features-in-old-browsers/

  • Author

Thanks Mike the site I'm building will actually be pretty straight forward I hope so some of the more complex features I shouldn't need I wouldn't of thought so hopefully they won't trip me up on lack of browser support. One of the things I'm particularly interested in though is a welcome video of the owner that could also be viewed on iphone, ipad etc.

Yh go for it, start making use of HTML5 now, it will become easier in the long run. For the very basic websites, you can pretty much code in complete HTML5.

The beauty of HTML5 is that it is intended to make things more logical and straightforward.

 

Take the doctypes for example:-

 

XHTML

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 

 

HTML5

 


<!DOCTYPE html>

 

 

You won't use all of HTML5's features straight away but there's nothing to stop you starting to use it now.

Edited by oakleaves

Depends on what you client requires. Look at his stats and if he has lots of visitors using IE 7 and 8 then I would suggest sticking with XHTML. If not, go for it with HTML5.

 

Good luck!

  • Author

Thanks for the replies guys really useful. Just to finish now I've had a little while to look at some of the new elements in html5...would I replace the div tag with a section tag if I say wanted 3 boxes of content side by side on a page?

 

@neilOwen the client has a very old site at the moment that doesn't have any analytic's or any meaningful content so I doubt there is any danger I will be isolating any loyal visitors because I doubt there are any.

  • Author

IE8 and html5?

 

According to w3 IE still has 18.3% of the market of which 11.8% is IE8 and previous.

  • Author

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

 

 

Damn I wish I had remembered you posted something about this before I clicked Add Reply :fool:

That Shim is only for a few base structural elements. To add support for other HTML5 elements in IE8, you need to look at other Polyfills, hence my post up top.

 

So whenever you use a HTML5 feature, check browser support. If there's gaps in support, use a Polyfill for that feature, in combination with Modernizr. Modernizr is feature detection, it detects whether a browser supports a feature or not, and if it doesn't, it loads the Polyfill. So only browsers that need the Polyfill actually download it.

  • Author

Cheers guys - Hows it going mteam been online lately might fancy a fix of some mw2 if your up for it one night?

Cheers guys - Hows it going mteam been online lately might fancy a fix of some mw2 if your up for it one night?

 

I've played quite alot of mw3 I'm still rubbish :) It would be good to have a few games back on mw2 or bops.

 

Not done any coding for a long time, I still need to look at getting to grips with wp just always seem to find something else to do :rolleyes:

  • Author

I've played quite alot of mw3 I'm still rubbish :) It would be good to have a few games back on mw2 or bops.

 

Not done any coding for a long time, I still need to look at getting to grips with wp just always seem to find something else to do :rolleyes:

 

Think I sold MW3 will have to check but yeah defo up for some MW2 poss Bops at some point - i'm not back to work until next Wednesday so might as well get at least one game in before then. I haven't been on much of late so will defo be a bit rusty I reckon :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.