I know how to create a website, but I've never done it using header tags etc... Only with divs, I don't know if it's wrong but the problem is that I already have a website ready that I had to deliver, is it necessary to use these tags?
I know how to create a website, but I've never done it using header tags etc... Only with divs, I don't know if it's wrong but the problem is that I already have a website ready that I had to deliver, is it necessary to use these tags?
No, it is not necessary, but it is advisable:
<div>
is short for division , then it is an element used to create divisions or "zones" in a document. But beyond its technical meaning it does not contribute anything from the semantic point of view.Imagine someone who cannot use a normal browser due to vision problems and uses a screen reader: Knowing which part of the page is the main one, which is the navigation menu and which parts are secondary is complicated if there are no further indications . To help with semantics, new tags appeared in the HTML standard (version 5) that help define not only visual "zones", but the function of those zones. In this way, what you want to represent is now more important than how in the HTML. An example:
<p>
.<b>
or<i>
, to choose between puttingbold
(bold) or italics . These tags are currently discouraged because they indicate how to display, which is the task of the styles (CSS). The correct thing would be to use<em>
(emphasize) or<strong>
(strong relevance) or<mark>
(important in the context).In the same way, search engines index the information of known pages according to their theme, content, accessibility... so using the correct tags helps them (and therefore helps you) to better classify your page.