body {
background: gray;
font-family: sans-serif;
width: 960px;
margin: auto;
}
header {
background: green;
border: 10px solid black;
}
nav {
margin-top:10px;
background: #62D99C;
border-radius: 10px;
padding: 10px;
}
Header and nav background does not work in IE8. It does work in Chrome and FF. What should I do?
Thanks!
You should apply
display:blockto the header and nav elements:It seems you also need to include the following js:
The reasons for this can be found here:
http://tatiyants.com/how-to-get-ie8-to-support-html5-tags-and-web-fonts/
Put simply, IE8 doesn’t support HTML5 elements by default, but by having this javascript execute (only for IE8 or less) it starts to recognise those elements. Most developers use some form of
html5 shimto fix this.http://code.google.com/p/html5shim/