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 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,649 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