首页 > 编程 > HTML > 正文

HTML5 浏览器支持

2020-03-24 17:12:14
字体:
来源:转载
供稿:网友
title Creating an HTML Element /title script document.createElement( myHero ) /script style myHero { display: block; background-color: #ddd; padding: 50px; font-size: 30px; /style /head body h1 My First Heading /h1 p My first paragraph. /p myHero My First Hero /myHero /body /html

亲自试一试

已添加的 JavaScript 语句 document.createElement( myHero ),仅适用于 IE。


!--[if lt IE 9] script src= http://html5shiv.googlecode.com/svn/trunk/html5.js /script ![endif]--

以上代码是一段注释,但是 IE9 的早期版本会读取它(并理解它)。


!--[if lt IE 9] script src= http://html5shiv.googlecode.com/svn/trunk/html5.js /script ![endif]-- /head body h1 My First Article /h1 article London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. /article /body /html

亲自试一试

引用 shiv 代码的链接必须位于 head 元素中,因为 Internet Explorer 需要在读取之前认识所有新元素。


body {font-family: Verdana, sans-serif; font-size:0.8em;}header,nav, section,article,footer{border:1px solid grey; margin:5px; padding:8px;}nav ul {margin:0; padding:0;}nav ul li {display:inline; margin:5px;} /style /head body header h1 HTML5 SKeleton /h1 /header nav li a href= html5_semantic_elements.asp HTML5 Semantic /a /li li a href= html5_geolocation.asp HTML5 Geolocation /a /li li a href= html5_canvas.asp HTML5 Graphics /a /li /ul /nav section h1 Famous Cities /h1 article h2 London /h2 p London is the capital city of England. It is the most populous city in the United Kingdom,with a metropolitan area of over 13 million inhabitants. /p /article article h2 Paris /h2 p Paris is the capital and most populous city of France. /p /article article h2 Tokyo /h2 p Tokyo is the capital of Japan, the center of the Greater Tokyo Area,and the most populous metropolitan area in the world. /p /article /section footer p 2014 W3Schools. All rights reserved. /p /footer /body /html

亲自试一试

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表