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!

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

CSS Treehouse Club: CSS My First Web Page What's New in Your HTML

1,009 Points

what is the difference between an attribute and a metadata?

Is there any kind of differnce in between these two or is attribute one kind of metadata?

2 Answers

luther wardle
luther wardle
Full Stack JavaScript Techdegree Student 18,029 Points

metadata can describe attributes, and could be considered their children in some contexts. So the best way I can answer would be that an attribute provides functionality, while meta data might be better able to describe what that functionality actually is to the user or some other system that is reading off the attributes.

I hope that helps!

Both of these definitions are taken from the Mozilla Developer Network. It’s a great resource if you want to look specific information on HTML, CSS & JavaScript terms. 😁

Metadata is β€” in its very simplest definition β€” data that describes data. For example, an HTML document is data, but HTML can also contain metadata in its <head> element that describes the document β€” for example who wrote it, and its summary.

An attribute extends a tag, changing its behavior or providing metadata. An attribute always has the form name=value (the attribute's identifier followed by its associated value).