问题
I Want my CSS to work properly even for old browsers that does uses HTML5 tags.
I have used tag and defined a style associated with it, this style works perfect for new browser but doesn't work for old browser (text in tag is rendered as normal text)
Here is the code:
<style>
.nav {
color: red
}
nav {
display: block;
background-color: blue
}
</style>
<div>
<nav class="nav">
<p>this is nav text</p>
</nav>
This code does not work for old browsers.
How to solve this problem so as all tags used by me should render properly in all browsers.
回答1:
Insert minified distribution shiv in head element' (after or before your CSS):
<!--[if lt IE 9]>
<script src="[PATH]/html5shiv.js"></script>
<![endif]-->
https://code.google.com/p/html5shiv/
https://github.com/aFarkas/html5shiv
History behind it: http://www.paulirish.com/2011/the-history-of-the-html5-shiv/
来源:https://stackoverflow.com/questions/22267417/backward-compatibility-using-html5-tags