HTML <header>標(biāo)記是一個(gè)HTML5元素,它定義了一個(gè)標(biāo)頭,該標(biāo)頭通常包含HTML文檔中的徽標(biāo),搜索表單和介紹性信息。此標(biāo)記通常也稱為 <header>元素。
創(chuàng)建<header>標(biāo)記,后跟<article>標(biāo)記:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML5 header標(biāo)簽的使用(菜鳥教程 (cainiaoplus.com))</title> </head> <body> <header> <img src="/static/images/logo.png" alt="Logo"> </header> <article> <h1>Heading for Article</h1> <p>Text that appears under article</p> </article> </body> </html>測(cè)試看看 ?/?
IEFirefoxOperaChromeSafari
IE 9、Firefox、Opera、Chrome 和 Safari 支持 <header> 標(biāo)簽。
注釋:IE 8 或更早版本的 IE 瀏覽器不支持 <header> 標(biāo)簽。
<header> 標(biāo)簽定義文檔或者文檔的一部分區(qū)域的頁(yè)眉。
<header> 元素應(yīng)該作為介紹內(nèi)容或者導(dǎo)航鏈接欄的容器。
在一個(gè)文檔中,您可以定義多個(gè) <header> 元素。
注釋:<header> 標(biāo)簽不能被放在 <footer>、<address> 或者另一個(gè) <header> 元素內(nèi)部。
<header> 標(biāo)簽是 HTML 5 中的新標(biāo)簽。
<header> 標(biāo)簽支持 HTML 的全局屬性。
<header> 標(biāo)簽支持 HTML 的事件屬性。