Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of compatibility in browser

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

I would like to share with you an example analysis of compatibility in browsers. I believe most people don't know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's take a look at it!

Browsers are two factions, one is other browsers and the other is IE (this TM is a heresy).

The difference between browsers is mainly in four parts.

1. The default values for margin and padding are different for various elements.

2.ie is different from the CSSS box model of other browsers. Ie's width and height include padding and border, while the CSSS box model of other browsers is the standard box model. Height and width refer to the width and height of content.

3. There are different levels of support for css3.

4. There are different levels of support for ES5 and ES6.

The label of 5.html5.

Media query of 6.css3

Corresponding solution:

1. With the introduction of normalize.css, the attributes of various elements such as margin and padding can be unified.

An attribute of 2.css3, box-sizing, defines the box model in which the element is rendered. Content-box is the standard box model and border-box is the box model of IE.

3. Introduce PIE.htc or other files that can make IE compatible with css3, but they all have limitations and are not fully compatible with all the features of css3.

4.IE8 is partially es5-enabled and es5-shim.js can be introduced. Ps: accidentally saw es5-sham check the difference between them. Es5-shim implements native ES5, while sham implements some new API. This allows you to program with es6 and compile with babel.

5. The introduction of html5shiv.js allows ie to support html5 tags.

6. Respond.js can be introduced to enable ie to use media queries to achieve responsive development.

The above is all the contents of the article "sample Analysis of compatibility in browsers". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report