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 HTML Basics Images, Text and Links Captioning Images

figure tag is over kill dont u think having x lines of code to display images ?

is it necessary?

1 Answer

Dan Weru
Dan Weru
47,637 Points

Hi, hahaha, I agree with you to some extent. It kinda feels that way, at least at first. That said, the figure tag is a semantic html5 tag. If you want to write semantic html, it is a necessary 'evil'.

Two, it helps screen readers and search engines (SEO) make better sense of your code. That is great for accessibility (it helps visually impaired individuals access you content better).

Three, in my experience, it helps with styling. Instead of wrapping my images with divs (which I have to assign classes or ids), using the figure element is a more elegant solution.

These are some of the reasons why I consider using the figure element sometimes.

thx the styling point is a good one haven't thought of that thanks mate