Permalink
Browse files

通过命名空间方式支持HTML5新标签,CSS能正常呈现,JS里也能用选择器选择得到

  • Loading branch information...
1 parent 600f4a0 commit de8d58050cf841f8c73f409a3624986d4f457236 @RubyLouvre committed Nov 19, 2012
Showing with 27 additions and 1 deletion.
  1. +1 −1 README.md
  2. +26 −0 index.html
View
@@ -1,4 +1,4 @@
IE6-7-namespace-html5
=====================
-通过命名空间方式支持HTML5,CSS能正常呈现,JS里也能用选择器选择得到
+通过命名空间方式支持HTML5新标签,CSS能正常呈现,JS里也能用选择器选择得到
View
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html5="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <title>不使用JS,让IE6-8支持HTML5</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style>
+ .section, section, html5\:section {
+ display: block;
+ padding: .5em;
+ border-left: 3px solid #ddd;
+ color: #999;
+ }
+ </style>
+ <script>
+ window.onload = function(){
+ alert( document.getElementById("aa").innerHTML)
+ alert( document.getElementsByTagName("section")[0].innerHTML)
+ alert( document.getElementsByTagName("SECTION")[0].innerHTML)
+ }
+ </script>
+ </head>
+ <body>
+ <html5:section id="aa">xxxxxxxxxxx</html5:section>
+ </body>
+</html>

0 comments on commit de8d580

Please sign in to comment.