E
E
Evgeny Bakulin2015-11-15 17:54:26
css
Evgeny Bakulin, 2015-11-15 17:54:26

Header, footer,... and div tags - is there a difference?

It's no secret that HTML5 introduced a number of "semantic" tags: header, footer, article, aside - is there any difference from divs?
Do I understand correctly that the appropriate use of these tags makes the html code easier to read, more understandable, functionally the same - all the same can be done on divs?
Are there any other pros/cons of using these tags over divs? (maybe search engines treat such pages better/worse, maybe there are nuances in browser support,...)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey delphinpro, 2015-11-15
@stranger2015

maybe search engines treat such pages better/worse

Bingo!!! This is the main reason (in fact) :)
Well, it is also easier to navigate in a semantically correct document for people who use alternative devices for viewing sites, for example, audio readers.
Well, it’s easier for other robots to understand your page.

A
amf1k, 2015-11-15
@amf1k

Just read this

V
Valera Udav, 2015-11-16
@TARAKANhoy

As it was correctly said, the reason is in the semantics of the code. In fact, roughly speaking, the entire page can be laid out even on a span if you give them the display: block parameter; however, such layout will not satisfy semantics. Search engines read the site by tags, and if all the div blocks for it are exactly the same, then the header, footer, nav, aside, etc. tags. make it immediately clear what kind of part of the page it is (the nesting of tags also matters, the same header can be used not only for the header of the entire site). Moreover, Google gives less priority to sites that are not laid out with semantic html5, so this is also SEO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question