0

I wanted to start using HTML 5 semantics for a header on my site, however when I looked into some documentation, I wasn't necessary sure that the <header> tag could be used for my site header which would occupy the <nav> property. Is that what header could be used for instead of the classical <div id='header'>?

4

3 Answers 3

6

Source

The element represents a container for introductory content or a set of navigational links

So it means that some browsers and search engines may look at your <header> element and interpret it with some meaning.


<div id="header"> - there is block element with no additional meaning.

Sign up to request clarification or add additional context in comments.

2 Comments

When we say "additional meaning," does that exclusively mean search engine bots scrapping the site? Or accessibility (screen readers)? Or something else?
@Majo0od Whatever who supports HTML5 and tries to get as much info about your site structure as possible.
1
<div id="header"> 

is nothing but a div with id header; you have to specify it's style in css

<header> 

is a HTML5 tag , which already meant to do some flavour.

It is suggested to use <header> in order to get your page fully HTML5 compliant

Comments

-1

If you use the <header> syntax, the browser knows that it is reading a header. If you want to use the HTML5 syntax I recommend you use the header tag.

2 Comments

I'm not sure if the tags tell the browser anything but if I'm not mistaken it does tell SEO what an element represents.
you said in other words what I wrote

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.