Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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).