Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website HTML First Create the Content Containers

Florentin Dumitrache
Florentin Dumitrache
3,757 Points

Why we use <header> , <section>, <footer> ?

Why we use <header> if it hasn't any impact on the web page . Why we put h1 ... h6 tag in a header , what is the purpose? I've noticed that if i delete the header tags is the same result . Same for section and footer.

2 Answers

Evgeniia Mas
Evgeniia Mas
4,452 Points

From the point of view how your Webpage looks like, yes, you won't notice the difference of using footer or div tags, but it is very important for search machines when your page is in Internet. Semantic site with such parts used according to the rules looks "better" for them and such one will be higher in search than others. It is good way to do everything right from very beginning if you think about your page's future. And also don't you think it is more clear when you work on your code and maintain it in future (you or any other developer and may be when you come back after a very-very long time) to understand what part is footer or header)) and absolutely different situation if you have not that ones, but a huge amount of similar divs. So it is in very short for SEO friendly semantic sites and nice structure for your HTML. And you mustn't insert header tags and so on if you have no such content on your page. Rules and real project's features have to be balanced together as I think.

They are semantic elements. As you pointed out, they doesn't necessarily add any functionality, but are meant to make the code more readable for humans. Check out this page, of you want to read about it:

https://www.w3schools.com/html/html5_semantic_elements.asp