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 Creating HTML Content Add Image Gallery Content

Dave Haddad
Dave Haddad
2,807 Points

HTML5

For this tutorial, would it be better to use <fig> and <figcaption> html5 elements as opposed to <img> and <p>?

Hi Dave,

I fixed your missing tags by wrapping them in single backticks. The backtick is usually located above the tab key and on the same key as ~

See this thread for more info on posting code: https://teamtreehouse.com/forum/posting-code-to-the-forum

2 Answers

James Barnett
James Barnett
39,199 Points

I think you can make a case for it either way.


Officially according to the HTML5 spec:

The figure element represents a unit of content, optionally with a caption, that is self-contained, that is typically referenced as a single unit from the main flow of the document, and that can be moved away from the main flow of the document without affecting the document’s meaning.

from: http://www.w3.org/TR/html-markup/figure.html

May Loh
May Loh
5,213 Points

<fig> and <figcaption> are semantics. These are meant for figures, charts, graphs, etc. and their respective captions, if any.

It really depends on what you want to insert. <img> is meant for pictures, photos and such. <p> is meant for paragraph spacing.

Dave Haddad
Dave Haddad
2,807 Points

That makes sense May. Thank you!