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 trialRaymond Franks
180 PointsWhat is an HTML attribute?
What is an HTML attribute, and how is it written within the HTML structure?
2 Answers
Mark Shiel
12,225 PointsAn attribute is additional information specified within a tag. It is presented in the format attribute="value".
Example:
<tag attribute="value">tag content</tag>
A working example would be the <a> tag used to form a link, the tag itself encloses the content which will become a link but it is the attribute "href" which is used to specify where the link points to.
Example:
<a href="link.html">link</a>
lucybeck
6,055 PointsThis link helps: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
Jason Anders
Treehouse Moderator 145,860 PointsJason Anders
Treehouse Moderator 145,860 PointsMOD edit -> added markdown (3 back ticks) before and after code so it will be visible in your answer.