Introduction to browser compatibility solutions and compatibility Solutions
1. compatible with those browsers
Decide which browsers are compatible according to the user group:
(1) targeting common users
IE8 +, Chrome, Firefox
(2) enterprise-level products
IE9 +, Chrome, Firefox
How to Understand the browser market share:
Baidu statistics: http://tongji.baidu.com/data/browser/
2. browser compatibility Solution
1. css cascade principle
1 div {2 display: -webkit-box;3 display: -webkit-flex;4 display: -moz-box;5 display: -ms-flexbox;6 display: flex7 }
As shown in the code above, for the same attribute, the value written later will overwrite the value written earlier, and the attribute values that are invalid for the browser will be ignored.
2. Condition comments
For Conditional comments on IE6, IE7, IE8, and IE9, see the following code:
<!--[if lt IE 7]>
Effect:
(1) chrome:
(2) IE (such as IE8 ):
In this way, the compatibility of different browsers can be processed, such:
1. ie8. selector {2/* style */3}
3. CSS hack
For specific examples, see the following code:
1 <! DOCTYPE html> 2