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 make HTML5 and CSS3 websites run in Microsoft browsers?

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

Share

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

This article introduces how to make HTML5 and CSS3 websites run in Microsoft browser, the content is very detailed, interested friends can refer to, hope to be helpful to you.

At first, IE was actually a very enterprising browser. But after a period of dormancy, it has become an obstacle in our lives. Microsoft is now challenging other browsers again, but the truth is that the new version of modern IE has lagged behind Google and Firefox. We also had to find a way to be compatible with early IE browsers. Here are three ways to make your HTML5&CSS3 site run miraculously in Microsoft's main browsers!

Htmlshiv.j

The HTML5shiv tool developed by Remy can use JavaScript to create main, header, footer and other HTML5 elements in old-fashioned IE. In other words, you can use JavaScript to create these new HTML5 elements that don't exist. What is the principle of this? It may take you days to figure it out, but who cares! This script is a must-have js for almost all official websites.

The code is as follows:

Selectivizr.js

Selectivizr.js is an amazing tool that provides a large number of CSS selectors and properties that IE does not support, including all last-child selectors. Recently, in the process of revamping the website, I used selectivizr, and the website can be displayed normally in the old IE browser. Here is the code snippet I used:

The code is as follows:

Modern new technology WEB project indispensable js library. It will only be loaded in the old IE.

Conditional judgment comment

You must have seen this extremely ugly conditional judgment note. However, ugly as it is, it allows your web page to run the way you want it to:

The code is as follows:

This code does not need JavaScript, does not need to wait for JavaScript to load, the CSS style you define will take effect immediately, without the kind of style flicker due to load delay.

On how to make HTML5 and CSS3 sites also run in Microsoft browser to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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