css - Why can't be <header> tag renamed in html? -


in following code tags defined inside style tags except <header> can renamed,

    <!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 capital city of england. populous city in united kingdom, metropolitan area of on 13 million inhabitants.</p>     <p>standing on river thames, london has been major settlement 2 millennia, history going founding romans, named londinium.</p>     </section>      <footer>     copyright © w3schools.com     </footer>      </body>     </html> 

if rename, say, <nav> tag <mytag> code renders same before. if rename <header> tag <myheader> doesn't render code same before. why so? special in <header> tag?

you can. change

header {   background-color:black;   color:white;   text-align:center;   padding:5px;      } 

to

myheader {   background-color:black;   color:white;   text-align:center;   padding:5px;     display: block; } 

notice "display: block"

here's jsfiddle: https://jsfiddle.net/url383l7/1/


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -