Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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