HTML5 tags background won't show in IE7 or IE8

benjamin.morgan

New Member
This works perfectly in IE9 but if I have a section tag with a background it won't work in ie6, iE 7 or IE8, If i change the section tag to a div tag it works like it should, why can't i do it with the section tag?
I have even declared the section tag display: block;

Hopefully someone can help
 

howtogurus

New Member
keep in mind that the current standard HTML is still 4, so you will find lots of HTML 5 stuff that is not supported in older browsers. Even the current browsers interpret HTML 5 differently in several instances. HTML 5 is neat, but needs lots of testing to make sure what you want to do is compatible with current browsers. Also since HTML 5 hasn't yet been approved as a standard, things may change radically over the next couple of years.
 

Phreaddee

Super Moderator
Staff member
@howtoguru.
You are correct in that html 4.01 is the “official“ latest standard.
However it is only ie8 & below that doesnt support html5.
So its just a matter of getting them to play nice.
It is also too far down the development path for any “drastic“ changes.
(they always happen BEFORE last call) so its only bug fixes and usability changes, it would be doubtful if any elements get scrapped...
Its already heavily tested by whatwg, w3, user groups, and the internet community at large.
 

ronaldroe

Super Moderator
Staff member
All the Shiv does is create the HTML5 elements in the DOM using JavaScript so IE8 and below will recognize them as elements when CSS is applied. Most other browsers allow you to do this just by defining CSS values for them. For instance, you could define <chickenSandwich> in Chrome just by using it and applying display:block to it along with your other styles. The same can be done in IE with:
HTML:
<script>
     var element = document.createElement(chickenSandwich);
</script>
 

Phreaddee

Super Moderator
Staff member
indeed you are correct ronald, but it does actually save you the hassle of manually typing such things!
 

ronaldroe

Super Moderator
Staff member
You're completely right. I was just breaking down what it does specifically, plus why and how. I use it myself, on every single site I code.
 
Top