New course! Every coder should learn Generative AI!
Try a free lesson0
<div class="header"/> or <header> ?
is there some cases where using <div class="header"/> or <div class="footer"/> would be more beneficial than using <header> or <footer>? After visiting many websites, and inspecting their elements, I noticed that they use many div with certain classes instead of <figure> <footer> .. other semantic elements.
2 Answers
+ 3
Before HTML 5 we used divs to seperate sections in our pages. HTML 5 comes with semantic tags <audio>, <video>, <header>, <footer>, <canvas>, <article>, etc
+ 3
Semantic tags are very important for the readability of the code, as well as for the browser's SEO score. Therefore, definitely, you need to use the semantic tag "header"