What are the pros and cons of adopting HTML 5 now

2019-06-16 11:52发布

问题:

I'm working on a large site’s re-write and redesign. I have been reading up on HTML 5 and wanted to know what the cons are before adopting it for this design implementation.

The design needs to work in A-grade browsers (yes including IE6 :( ), so I'm wondering how <footer> / <section> etc will be rendered (inline/block etc.).

I'd also like to know the pros so that I can sell it to any conservatives within the business.

回答1:

If we disregard the things which are unchanged since HTML 4.01…

Pros? Not a lot. There are a few things which work in a minority of browsers. There are a few things which work in a minority of browsers but with added JavaScript can support most browsers in a relatively sensible way.

As for cons…

  • The whole spec is still a draft, and subject to change.
  • Practically nothing in the spec is supported consistently across browsers (and faking it with JS fails when JS isn't around)
  • QA tools are immature and often lag behind the specification

It's useful as something to experiment with, but I wouldn't build a mainstream website with it.



回答2:

HTML5 isn’t one thing. There are some parts of HTML5 you can use right now.

For instance, you can change your doctype to the HTML5 one (<!doctype html>). Boom. Your document is now HTML5. Because the HTML5 spec was based on a lot of work figuring out what browsers already do, things like this just work. So, if you prefer the HTML5 syntax, feel free to do that now.

As for the new elements, as has been mentioned, they’re lacking support in IE. You can shim quite a lot of support for HTML5 into IE with JavaScript, if you’re happy with that. Note that unknown HTML elements are displayed as inline by all browsers, so you’d need to add display: block; for new block-level elements yourself for older browsers.

Dive into HTML5 is well worth a read to get you up to speed, particularly Chapter 3.



回答3:

Pros:

  • The more sites are using it, the faster we'll have a reliable spec and support across browsers. So just by building your new site with HTML 5, you help speeding up the advancement of web technologies for all of us.

Cons:

  • Incomplete QA tools
  • Incomplete native browser support

The argument that the whole spec is still a draft doesn't really count. Just look at CSS. Even the latest changes to the CSS 2.1 recommendation still have draft status.



回答4:

If you want to use the HTML 5 specific elements, take a look at http://ejohn.org/blog/html5-shiv/. This approach allows you to use the HTML in browsers that don't support them now.



回答5:

There are no cons - most of the things will work just as they do in XHTML 1.0 or HTML 4.01. Pros will slowly come in next few years, but bring more semantics (and somehow easier understanding of the content by search engine bots from SEO point of view). HTML 5 moreover enables designers to use any web fonts (not just the limiting basic five such as Arial/Helvetica, Verdana, Times New Roman etc.)

see this as well:

http://www.alistapart.com/articles/semanticsinhtml5/

http://www.zeldman.com/2009/07/13/html-5-nav-ambiguity-resolved/

http://www.zeldman.com/2009/07/20/web-fonts-html-5-roundup/