h5 compatibility handling

1. In browsers that do not support HTML5 new tags, these new tags will be parsed into inline elements (inline), so we only need to convert them to block elements (block) to use, but in IE9 version below , And ca n’t parse these new tags normally, but can recognize the custom tags created by document.createElement ('tagName'), so our solution is to pass all the new HTML5 tags through document.createElement ('tagName') Create it again, so that the lower version of IE can also parse HTML5 new tags normally.
2. Processing method: In actual development, we use more to detect the version of IE browser to load a three-party JS library to solve the compatibility problem (test the compatibility under IE: the use of ieTester software)
<script src = "../ js / html5shiv.min.js"> </ script>

The problem we solved is mainly for the low version of ie, that is, only the low version of ie is executed.
~~~ html
<!-[if lt IE 9]> <script src = "js / respond.js"> </ script>   <script src = "js / html5shiv.min.js"> </ script> < ! [endif] —> ~~~ respond.js The purpose is to solve the CSS3 media query media query of the low version of ie
  



 

 

 

Conditional comment

<!-[if! IE]> <!-> Recognizable except IE <!-<! [endif]->
<!-[if IE]> All IE can be recognized <! [ endif]->
<!-[if IE 6]> Only IE6 can recognize <! [endif]->
<!-[if lte IE 6]> IE6 and below IE6 can recognize <! [endif] ->
<!-[if gte IE 6]> IE6 and IE6 and above can be recognized <! [endif]->
<!-[if IE 7]> Only IE7 can be recognized <! [endif]- >
<!-[if lt IE 7]> IE7 and below can be recognized <! [endif]->
<!-[if gt IE 7]> IE7 and above can be recognized <! [endif]->
< !-[if IE 8]> Only IE8 can recognize <! [endif]->
<!-[if IE 9]> Only IE9 can recognize <! [endif]->

 

Guess you like

Origin www.cnblogs.com/pxxdbk/p/12680807.html