HTML5新增的语义标签和IE版本低的兼容性问题

本文介绍了一种使用HTML5进行网页布局的方法,通过设置section、article等标签的样式属性实现页面的展示效果。文章包含了具体的HTML5代码示例,展示了如何在不同浏览器下保持良好的兼容性。

<!DOCTYPE html>
<html>
<head>
<!-- HTML5中浏览器兼容(较低版本的IE浏览器不支持H5的布局):需要在<head>中加入
<!-[if lt IE9]><script src="html5.js"></script><![endif]->(html5.js是外部引入文件),
在head中的<style></style>中加入section、article、header、footer、aside等标签的样式属性,
如section {width:660px;margin:0 auto}。注意:如果加兼容性的判断的话,需要加完整的html、head、body等标签。-->
<!-[if lt IE9]>
<script src="html5.js"></script>
<![endif]->
<meta charset="utf-8" />
<title>布局示范</title>

<style>
section {width:660px;margin:0 auto}
article {width:500px;float:left}
header {width:100%;background:#ddd;text-align:center}
footer {width:100%;background:#ddd}
aside {width:150px;float:right}
</style>
</head>
<body>
这是HTML5!!!<br />
<section>这是h5</section>
<section>这是h5</section>
<section>这是h5</section>
<section>这是h5</section>

<footer>这是脚</footer>
<footer>这是脚</footer>
<footer>这是脚</footer>
<footer>这是脚</footer>
</body>
</html>

 

转载于:https://www.cnblogs.com/blogforly/p/5645225.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值