Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

header in HTML5 [duplicate]

Tags:

html

css

header

Possible Duplicate:
<header> vs. <head>

Do I have to use <div class="header"> as <header> in HTML5? Somebody explained one question like that <header> vs. <head>. I am a bit confused. Thanks for any help. I appreciate it.

like image 327
pepsicode Avatar asked Jun 28 '26 00:06

pepsicode


2 Answers

As the linked question explains:

   <head>
     <title>Your page | Your company</title>
     <meta name="keywords" value="blah blah"/>
     <link rel="stylesheet" href="css/style.css">
     <script></script>
   </head>

is still the same in HTML5, for storing meta information and linked scripts etc.

Header is a new element for grouping the header of a page or section symantically.

Including James Simm's info:

Technically, the element in HTML5 represents a group of introductory, or navigation aids. It isn't just for a given page or document. can be used within sectioning elements such as or too. See WHATWG for more info

   <header>
     <h1>Your page heading</h1>
     <nav>
        <ul><li>Global Nav Item 1</li></ul>
     </nav>
   </header>
like image 73
Rob Stevenson-Leggett Avatar answered Jun 29 '26 12:06

Rob Stevenson-Leggett


You do not need to use any of the new tags in HTML5. You can use them if you want though.

<header> is a semantic tag to mark the header section of your site while <head> is the are where things like meta tags go.

like image 34
ThiefMaster Avatar answered Jun 29 '26 14:06

ThiefMaster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!