


How to deal with old versions of browsers that are not compatible with H5 and C3
This time I will bring you how to deal with the problem that the old version of the browser is not compatible with H5 and C3. How to make the old version of the browser support HTML5? What are the precautions for older browsers to be compatible with H5 and C3? The following is a practical case, let’s take a look.
HTML5 can do a lot for us, the most delicious is the application of semantic tags. If you have used its awesomeness on Chrome or other browsers that support HTML5, then This article must be useful to you, because now you can also use HTML5 on IE.
The first method: use Google’s html5shiv package (recommended)
First of all, you have to quote the following html5.js file from Google. The benefits will not be mentioned:
<!--[if IE]> <script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script> < ![endif]-->
Copy the above code to the head part, remember it must be the head part (because IE must know this element before the element is parsed, so this js file cannot be called in other locations, otherwise it will be invalid)
Mainly to let These html5 tags are in blocks, like divs. Okay, let’s keep it simple, in one sentence: quote html5.js to make html5 tags blocky
Second method: Coding JavaScript
<!--[if lt IE9]> <script> (function() { if (! /*@cc_on!@*/ 0) return; var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video".split(', '); var i= e.length; while (i--){ document.createElement(e[i]) } })() </script> <![endif]-->
But no matter how you use it Either of the above methods must initialize the CSS of the new tag. Because HTML5 behaves as inline elements by default, to layout these elements we need to use CSS to manually convert them into block elements for convenient layout.
/*html5*/ article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}
But if users of ie6/7/8 disable scripts, it will become an unstyled "whiteboard" web page. How should we solve it?
We can refer to Facebook's approach , that is, guiding the user to enter the "/?_fb_noscript=1" page with the noscript logo, and replacing the html5 tag with the html4 tag. This is lighter than writing a lot of hacks to maintain compatibility.
<!--[if lte IE 8]> <noscript> <style>.html5-wrappers{display:none!important;}</style> <div class="ie-noscript-warning">您的浏览器禁用了脚本,请<a href="">查看这里</a>来启用脚本!或者<a href="/?noscript=1">继续访问</a>. </div> </noscript> <![endif]-->
This can guide the user to open the script, or jump directly to the HTML4 tag design interface.
2. Make old browsers compatible with CSS3 (incomplete compatibility solution)
As of Internet Explorer 8, the IE series does not support CSS3. To do some common effects in IE such as rounded corners and shadows, you need to use some redundant and meaningless elements and pictures to create these effects. After getting tired of these, I thought about using more concise, direct, effective, CSS3-style methods to solve these problems. Fortunately, even Internet Explorer, which has been criticized, is powerful enough in its own right. IE's unique technology can achieve some CSS3 effects very well.
OpacityTransparency
The transparency of elements can be easily achieved using filters in IE.
background-color:green; opacity: .4; filter:progid:DXImageTransform.Microsoft.alpha(opacity=40);
Translucent area here
opacity: .4;
filter:alpha(opacity=40);
border-radius rounded corner/Box Shadow box shadow /Text Shadow text shadow
You can use Vector Markup Language (VML) and javascript to achieve these effects in IE, see IE-CSS3, after citing an HTC file, inIE browserYou can use these three CSS3 properties.
I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!
Related reading:
Detailed steps to create a book management platform using vue.js
How to count table sum in bootstrap The number
vue.js todolistHow to implement
The above is the detailed content of How to deal with old versions of browsers that are not compatible with H5 and C3. For more information, please follow other related articles on the PHP Chinese website!

H5 brings a number of new functions and capabilities, greatly improving the interactivity and development efficiency of web pages. 1. Semantic tags such as enhance SEO. 2. Multimedia support simplifies audio and video playback through and tags. 3. Canvas drawing provides dynamic graphics drawing tools. 4. Local storage simplifies data storage through localStorage and sessionStorage. 5. The geolocation API facilitates the development of location-based services.

HTML5 brings five key improvements: 1. Semantic tags improve code clarity and SEO effects; 2. Multimedia support simplifies video and audio embedding; 3. Form enhancement simplifies verification; 4. Offline and local storage improves user experience; 5. Canvas and graphics functions enhance the visualization of web pages.

The core features of HTML5 include semantic tags, multimedia support, offline storage and local storage, and form enhancement. 1. Semantic tags such as, etc. to improve code readability and SEO effect. 2. Simplify multimedia embedding with labels. 3. Offline storage and local storage such as ApplicationCache and LocalStorage support network-free operation and data storage. 4. Form enhancement introduces new input types and verification properties to simplify processing and verification.

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.

H5 and HTML5 are different concepts: HTML5 is a version of HTML, containing new elements and APIs; H5 is a mobile application development framework based on HTML5. HTML5 parses and renders code through the browser, while H5 applications need to run containers and interact with native code through JavaScript.

Key elements of HTML5 include,,,,,, etc., which are used to build modern web pages. 1. Define the head content, 2. Used to navigate the link, 3. Represent the content of independent articles, 4. Organize the page content, 5. Display the sidebar content, 6. Define the footer, these elements enhance the structure and functionality of the web page.

There is no difference between HTML5 and H5, which is the abbreviation of HTML5. 1.HTML5 is the fifth version of HTML, which enhances the multimedia and interactive functions of web pages. 2.H5 is often used to refer to HTML5-based mobile web pages or applications, and is suitable for various mobile devices.

HTML5 is the latest version of the Hypertext Markup Language, standardized by W3C. HTML5 introduces new semantic tags, multimedia support and form enhancements, improving web structure, user experience and SEO effects. HTML5 introduces new semantic tags, such as, ,, etc., to make the web page structure clearer and the SEO effect better. HTML5 supports multimedia elements and no third-party plug-ins are required, improving user experience and loading speed. HTML5 enhances form functions and introduces new input types such as, etc., which improves user experience and form verification efficiency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download
The most popular open source editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
