Semantic Flashcards
what is semantic in html?
Certain elements have actually a meaning or a purpose attached to them.(p,strong,footer,aside, a, …)
So when we think about a certain HTML element, we should actually not only think about what that element looks like as it’s rendered on the page. But instead we should think about what that element actually means and what it stands for.
💡Not all elements in html are semantic. div, span,em,i.., are generic element.
if we wanted, we could in fact build the entire webpage only out of div, but now we should only use the div element when we don’twant to attach a certain meaning to a certain container.
Why semantic in html???
one of the reasons is a search engine optimization, which basically means that a search engine such as Google will be able to understand the structure of your content. And therefore they will be better able to analyze what your content and what your webpage is all about.
Also writing semantic HTML is extremely important for accessibility and especially for people who rely on screen readers to consume on web pages.