2016-01-27 37 views
0

在風格標籤內定義除了<header>下面的代碼的所有標籤可以被重新命名,爲什麼不能在html中重命名<header>標籤?

<!DOCTYPE html> 
    <html> 
    <head> 
    <style> 
    header { 
    background-color:black; 
    color:white; 
    text-align:center; 
    padding:5px;  
    } 
    nav { 
    line-height:30px; 
    background-color:#eeeeee; 
    height:300px; 
    width:100px; 
    float:left; 
    padding:5px;   
    } 
    section { 
    width:350px; 
    float:left; 
    padding:10px;   
    } 
    footer { 
    background-color:black; 
    color:white; 
    clear:both; 
    text-align:center; 
    padding:5px;   
    } 
    </style> 
    </head> 
    <body> 

    <header> 
    <h1>City Gallery</h1> 
    </header> 

    <nav> 
    London<br> 
    Paris<br> 
    Tokyo 
    </nav> 

    <section> 
    <h1>London</h1> 
    <p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p> 
    <p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p> 
    </section> 

    <footer> 
    Copyright © W3Schools.com 
    </footer> 

    </body> 
    </html> 

如果我重新命名,比如說,<nav>標籤<mytag>即使在當時的代碼將呈現與以前一樣。但是,如果我將<header>標記重命名爲<myheader>,那麼它不會呈現與以前相同的代碼。爲什麼如此? <header>標籤有什麼特別之處?

+1

我能想到的最好的例子。將