chm*_*ike -2 css html5 internet-explorer
我最近重构了我的网站以使用HTML5.它适用于大多数浏览器,显然,IE7和IE8除外.
它看起来像是由于使用了<header>,<section>和<article>标签,这些标签显然被IE7忽略了.我的css为这些定义了特定的标记格式化子类.
header { color: #fff; background: url("background1.jpg");
padding: 10px 40px 20px 40px; margin-bottom: 20px; }
header a { color: #fff; text-decoration: none; outline: none; }
header a:hover { color: #fff; text-decoration: underline; }
header h1 { color: #FFFFFF; font-weight: bold; font-size: 30px;
padding-bottom: 20px; padding-top: 0px; }
header h2 { color: #FFFFFF; font-weight: bold; font-size: 16px; padding-bottom: 10px; }
header hr { margin: 10px 10px 0px 0px; }
header .copyright { font-style: italic; font-weight: bold;
padding-left: 30px; padding-right: 0px; }
section { padding: 5px 40px 5px 40px; line-height: normal; }
article .main { font-weight: bold; font-size: 20px; line-height: normal; }
Run Code Online (Sandbox Code Playgroud)
我跳过了其他不会导致问题的样式定义.
我怎么能解决这个问题?我是否必须删除HTML5标签?
您可以在头部使用此脚本:
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
大多数html5都在IE中为我工作:-)
| 归档时间: |
|
| 查看次数: |
101 次 |
| 最近记录: |