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

How to deal with the compatibility problem of CSS browser

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you how to deal with CSS browser compatibility issues, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!

What is a browser compatibility issue?

Understanding the browser kernel

Browser type kernel js engine

IETridentjscript

FirefoxGeckoTraceMonkey

ChromeWebKit,BlinkV8

SafariWebKitSquirrelFishExtreme

OperaPrestoCarakan

The solution to the compatibility problem of css browser

1. Using cssHack to solve compatibility issues

Browsers may encounter unrecognized code when reading css code, and there are usually two reasons for this:

1. There is something wrong with the code itself, such as: bg:red,bg is not a valid css attribute

two。 The code is fine, but the kernel of the browser cannot recognize it, such as box-sizing:border-box. There is no problem with this code itself, but because it uses the attribute box-sizing of css3, it will not be recognized in some browsers with lower versions of the kernel.

In short, what does a browser do when it encounters unrecognized code? Unlike back-end languages such as java and C #, the browser does not abort the execution of the program, but immediately skips the unrecognized code and continues to execute the rest of the code as if it were not seen. Just like the following example:

.main {

The color1:red;/* code cannot be recognized by the browser, so the browser will assume that the code does not exist * /

Color:green

}

The above is all the contents of the article "how to deal with CSS browser compatibility issues". 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