I updated my web site to CSS 1 and Doc Type DTD HTML 4.01 Transitional six years ago.

I was planning on updating it to CSS 2 and XHTML to make it more current, efficient, and browser compatible.

Before I wade into another set of prematurely obsoleted books (like Head First, HTML Dog, and a dozen more I purchased for the job), I would like to know if HTML5 is going to torpedo my learning effort by making these recent XHTML/CSS code options obsolete?

Should I throw the books away and learn HTML5 as the code to use in updating my site?

3 answers


If it works and it's valid code, it ain't broken, so save yourself time and trouble and don't fix it.

However, your site isn't valid code, so use the validator and fix the errors, html4 is perfectly valid as a web standard.

Answered almost 8 years ago by Tony Crockford
danwellman 5600

HTML5 is a long way off, years in fact, from becoming a final specification yet, so there are varying amounts of support in current browsers for it. Some browsers support a lot of it and others support very little of it. Sometimes support for the same element differs between browsers and things are bound to change as time progresses. HTML5 doesn't replace HTML4.01 entirely, it merely adds new elements and attributes. Some attributes are also deprecated.

IE doesn't yet support any of the new HTML5 elements, and a JavaScript file needs to be used in order for IE to understand and display them correctly.

That said, there is no reason why you can't use the HTML5 doctype now (because its much smaller, easier to use, etc) . The doctype is there to trigger standards mode in the browser, it serves no other real prupose. You could still stick to using just HTML4.01 elements with the new doctype.

Most browsers now support most of CSS2, and many now support a lot of CSS3 (although usually you need to use browser-specific prefixes for CSS3 styles, like -moz-border-radius or -webkit-border-radius. CSS2 will give you a lot more control over your elements for styling and layout purposes so updating to this will certainly be beneficial. HTML5 won't change CSS2 at all, and CSS3 will only add new styles and build on the existing CSS2

Switching to XHTML won't make your website any more efficient or browser compatible (or modern) so there is no real need to switch ffrom HTML4.01 to XHTML, developers use either HTML4.01 or XHTML largely as a personal preference and there are arguments for and again both specifications. XHMTL did not replace HTML4.01

Answered almost 8 years ago by danwellman

I second to that.

Just fix your errors. If you'd like to improve the quality of your page, consider redesign it from the scratch, in order to be more web 2.0 friendly. Also, you can use some jQuery to spice up your site.

Answered almost 8 years ago by poscaman