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 trialDave Haddad
2,807 PointsHTML5
For this tutorial, would it be better to use <fig>
and <figcaption>
html5 elements as opposed to <img>
and <p>
?
2 Answers
James Barnett
39,199 PointsI 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.
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
2,807 PointsThat makes sense May. Thank you!
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi 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