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 trialSeokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,606 PointsIs <figure> attribute used for a communicative reason only? There is no visual difference whether I delete it or not.
Hi, I am Brandon.
'tag' and 'figcaption' attributes inside an <img> attribute have visible changes on the page: -tag: when you hover your mouse, you can see what you wrote with tag attribute -figcaption: what you wrote with 'figcaption' attribute will be located under the image
However, I deleted <figure> attribute and retype it, there was no different on the webpage.
So, can you explain about this <figure> attribute why does it need? For what purpose?
Thank you so much for your time and help. :)
2 Answers
Steven Parker
231,269 PointsFor proper HTML, a "figcaption" element should only be the first or last direct child of a "figure" element.
And besides the semantic value, the "figure" element also serves as a convenient target container for styling and layout using CSS. It may not have a different visual appearance by default, but you can always give it one in your stylesheet. Most of the the newer semantic elements are like that.
Seokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,606 Points@Steven Parker Thank you again and sorry for the late reply as I had flu :(
Seokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,606 PointsSeokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,606 PointsThank you Steven for your kind answer. :) So it's like <span>, a convenient way to interact with CSS.
Have a good day!
Steven Parker
231,269 PointsSteven Parker
231,269 PointsGeneric containers like "div" and "span" don't convey any semantic meaning. I'd consider this one more like "article", "nav" or "aside". On their own, they don't affect the appearance but they might have meaning to search engines or other content-aware processes.