Introduction to browser compatibility solutions and compatibility Solutions

Source: Internet
Author: User

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 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.