So I have a complete website written in HTML4 with CSS2/开发者_StackOverflow中文版CSS3 support - i.e. mainly taking advantages of most of the CSS3 where supported.
I want to upgrade the site to support HTML5 - but little confused [using Visual Studio 2010 / ASP.NET MVC etc] how I can support both HTML4 and HTML5 ?
Do I need to rewrite the entire site in HTML5 or ? Little confused how to support both HTML4 and HTML5 ?
You don't need to do anything.
HTML5 is an umbrella term for a collection of loosely-related client-side features supported by recent browsers.
You can just use any features you like.
Just make sure to implement a fallback so that the site still works in browsers that don't support the new features.
The Modernizr library can be very useful here.
You can use the new HTML5 tags even in HTML4.
However, you'll need to include a shiv to make them style-able in IE < 9.
Modernizr already includes this.
What HTML5-specific elements do you need on your page? Are you using things like audio, video, canvas, etc. elements? If you're not, then a HTML4-compliant site should be HTML5-compliant as well.
By the way, you can now get HTML5 Intellisense for Visual Studio 2010 and 2008.
精彩评论