Why use header tag if the program works fine without it? 🤷 Check the description section. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why use header tag if the program works fine without it? 🤷 Check the description section.

<!DOCTYPE html> <html> <head></head> <body> <header> <h1>Most important heading</h1> <h3>Less important heading</h3> </header> </body> </html> This is one of sololearn's code and if we remove header tag it gives same output so why did they even used it?

23rd Sep 2021, 6:29 AM
NiKlAuS
NiKlAuS - avatar
1 Answer
+ 3
We use header tag for styling, and also for browsers to know where is your header, where is nav where is footer, where is section and article. It's very important, than use div to divide your styling, base on what I read, it's also for search engine optimization. it's also for reading the code, it's easy to understand when you use header, nav, section, article and footer element.
23rd Sep 2021, 6:37 AM
Jonathan P. Jundarino
Jonathan P. Jundarino - avatar