开发者

What is HTML5 Semantic Layout?

Ok, This is a silly question but what does mean by开发者_StackOverflow 'HTML5 provides Semantic Layout'. What really is a 'Semantic Layout'?


This is in reference to a shift in how tags are named in the HTML markup. So in addition to things like div which could mean anything, there are new tags like:

  • header
  • article
  • aside
  • nav
  • footer
  • etc.

The use of these tags provides more information about the semantic content of the markup, as opposed to relying on specifications that are more about style than content (such as <div class="header">).

The idea here is that the content itself tells you "what" it is. A clear benefit is for things like screen readers for visually impaired users, which can more effectively present the content to the user in a more structured manner.


Semantic markup will shift the focus away from presentation to structure. For example, instead of using h tags to make text larger or smaller, you use h tags to denote text that serves as headings for paragraphs or sections.

Instead of generic divs with IDs or classes to denote their purpose, semantic markup will use tags such as header, footer and nav to clearly identify sections of the document.

The HTML markup will become purely structural and presentation information will be moved to a separate layer such as CSS.


HTML5 website layout

<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->

</head>

<body>

<header> </header>
<nav><ul>
<li></li>
</ul>
</nav>
<section> <article><figure><img src=""/></figure></article></section>
<footer>by siva </footer>

</body>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜