If you allow older browsers to support HTML5

Set the new element in CSS. The display attribute is a block-level element block

header, section, footer, aside, nav, main, article, figure
{
   display: block;
}

Browser issues before Internet Explorer 9

You can use "HTML5 Enabling JavaScript", "shiv" created by Sjoerd Visscher to solve this problem:

<!DOCTYPE html>
<html>
<head><meta charset="utf-8">
<title>渲染 HTML5</title>
<!--[if lt IE 9]>
<script src="//apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js">
</script>
<![endif]-->
</head>
<body>	
<h1>我的第一篇文章</h1>	
<article>	学习使我快乐!
</article>
</body>
</html>

Note: The reference code of html5shiv.js must be placed in the element, because IE browser needs to load the file first when parsing the new HTML5 element.

Published 89 original articles · Liked 83 · Visits 3498

Guess you like

Origin blog.csdn.net/devin_xin/article/details/105317909