1. Preface.
IE6, 7, and 8 support HTML5, which seems difficult. In fact, there is a very common method, which is to introduce js and css. This pluggable introduction is very helpful for development. For example, the following is an example of making a web page support canvas and css3.
2. Example.
The following is an html example of displaying a red ball in the canvas.
Java code
- < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-
- ; fewfwe
- >
background: #444; -
color: #FFF; -
font-family: Helvetica, Arial, sans-serif; -
text-align: center; -
} -
-
#cv { -
width: 600px; height: 400px; -
background: #000; -
border-radius: 20px; -
padding: 20px; -
margin: 20px auto; -
box-shadow: 0 0 40px #222; -
behavior: url(public/ie-css3.htc); -
} -
} -
> -
-
🎜> -
-
-
-
This example cannot be run in IE8, but Firefox can. If you want it to run on IE6, 7, and 8, you need to do two things.
2.1 Add an html5 ie auxiliary js file and a canvas compatible js file
This file can be named html5.js. This is an open source js file that can be used with confidence. It mainly It solves the problem of js compatible with html5 in versions 6, 7 and 8. The canvas compatible file is named excanvas.compiled.js, and I have packaged all files in the demo. Can be downloaded.
2.2. Add a css file and reference it on the page.
The css file is named ie-css3.htc, which solves the problem of ie6, 7, 8 and css3 compatibility.
3.demo download.
See attachment.
4. Example running results
See the picture below. It is a red circle displayed on a black canvas.
5. Summary
IE6, 7, and 8 are compatible with other HTML5 technologies. In fact, they can all follow the practice of citing js and css. In this way, the last obstacle has been cleared for HTML5 to take off on the mobile terminal.
- Test21.rar (13.6 KB)
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn