HTML5的兼容问题以及调用js文件的方法
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title></title> 6 <script src="js/html5shiv.js"></script>《直接加入script引用js文件来解决html5的兼容问题》 7 <!--<script> 8 document.createElement("header");《通过添加script给header和section以及footer来解决他们各自在ie6里面不支持宽和高的情况》 9 document.createElement("section"); 10 document.createElement("footer"); 11 </script>--> 12 <style> 13 header{ 14 width: 200px; 15 height: 200px; 16 display: block;《通过加入block样式来解决不兼容问题造成的不支持宽和高》 17 background-color: red; 18 } 19 section{ 20 width: 150px; 21 height: 150px; 22 display: block; 23 background-color: yellow; 24 } 25 footer{ 26 width: 100px; 27 height: 100px; 28 display: block; 29 background-color: blue; 30 } 31 </style> 32 </head> 33 <body> 34 <header>header</header> 35 <section>section</section> 36 <footer>footer</footer> 37 </body> 38 </html>
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步