Jump to content

When Should I Start Using HTML5 and CSS3?


newseed

Recommended Posts

Although HTML5 and CSS3 is still in the working stages, some of the browsers already support it. The question is when to start using the new standard?

 

Well, I found this site to be very helpful. It updates periodically and so it will help you determine when the best time to start using HTML5 and CSS3

 

HTML5/CSS3 Compatibility Chart

 

I give it 2-3 years before we start using it exclusively for Firefox, Safari, Opera, Chrome and IE9. However, IE8 or earlier will require the old standard thus will probably have to use conditional comments. Hopefully, IE6 will be gone by then.

 

The question I ask is how the older browsers will render using a HTML5 doctype? According to W3, the simpler doctype will work for older browsers but it wasn't clear as to how it works (if it does) when you validate web page?

Link to comment
Share on other sites

 

However, IE8 or earlier will require the old standard thus will probably have to use conditional comments.

 

The question I ask is how the older browsers will render using a HTML5 doctype? According to W3, the simpler doctype will work for older browsers but it wasn't clear as to how it works (if it does) when you validate web page?

 

It's not just a doctype issue. Apparently if you use the simple new doctype <!Doctype html> now there isn't much of a problem.

 

But if you code markup like <video>............</video> or <header>..........</header> how do you use a conditional comment for this to use different divs with an id or class except by putting two conditional comments in the markup, one for NOT IE and one for IE which I think is sloppy coding.

 

Edit:- Someone told me that the new doctype worked so I tried it on one of my sites and didn't see any difference in IE7 or Firefox, but I didn't do a comprehensive test. I think it's the CSS3 and HTML 5 new features that need to be avoided for many years until you think that most of your potential viewers have upgraded their browsers to the future browsers (ie long after the new browsers are released).

Edited by Wickham
Link to comment
Share on other sites

I'm definitely looking forward to being able to mark up my HTML with better semantic tags. Being able to mark up my document with things like <header>, <footer>, <article> etc will make both HTML and CSS code a little bit shorter, and hopefully easier to read.

 

I do agree that full browser support for HTML5 will take a while though, so I can't realistically see myself using HTML5 anytime soon -- at least the new tags that aren't supported across all browsers. I might take a look at it more this summer -- I think it's time for me to do some upgrades to my site (though not a full redesign) so I may want to learn more about this then.

Link to comment
Share on other sites

The smaller, simpler doctype has always worked for older browsers. That's not the issue. The doctype we are accustomed to is specifically for validation purpose. The issue is how one can validate a site using that method?

 

I guess the solution would be use the simpler doctype and then define the doctype version via the validator tool. Will there be a html5 doctype version? Transitional? Strict?

 

Again, all in working stages. I suspect that we will know more in the next couple of years because IE9 has really jumped on the band wagon which is good news for us developers.

Link to comment
Share on other sites

Here is all you need for html5. Maybe some PHP fix for IE will popup some day soon.

 

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>title</title>
<style>
header, footer, nav, section, article {
display:block;
}
header {
background:yellow;
}
nav {
width:30%; 
background:orange;
float:left;
}
section {
width:65%; 
background:green; 
float:right;
}
article {
width:70%; 
margin:40px 60px; 
background:turquoise;
}
footer {
background:pink; 
clear:both;
} 
</style>
<!--[if lt IE 9]><script>
document.createElement("header");
document.createElement("footer");
document.createElement("nav");
document.createElement("article");
document.createElement("section");
</script><![endif]-->
</head>
<body>

<header>header</header>
<nav>nav</nav>
<section>section
   <article>article</article>
   <article>article</article>
</section>
<footer>footer</footer>

</body>
</html>

Link to comment
Share on other sites

I've read about the javascript hacks to be able to create the new elements, but what about computers that have javascript disabled?

 

The markup with <video>...</video> or <header>...</header> may just display without any styles but the video won't show.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...