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 trial

HTML How to Make a Website Beginning HTML and CSS Write an HTML Element

Difference between tag and element

Hello! I would like to ask about the difference between tag and element.Is it the same thing?

6 Answers

Sara Victoria
Sara Victoria
1,249 Points

Sorry it didn't complete all my message.

here is a list of tags... Basic HTML Tags HTML, HEAD, BODY, TITLE Paragraphs, Headings, Line Breaks, and Dividers P, H1, H2, H3, H4, H5, H6, BR, HR
Character Entity References quotes, ampersands, angle brackets, and non-breaking spaces Lists OL, UL, DL Meaning vs. Layout Formatting and Phrase Elements B, I, EM, STRONG, U, TT, CODE, KBD, SAMP, VAR, SUB, SUP, INS, DEL, ABBR, ACRONYM, BLOCKQUOTE, Q, CITE, ADDRESS, DFN, BDO, PRE, FONT URLs and Paths mages IMG
All about Links - Hyperlinks, Buttons, and Bookmarks A Tables TABLE, TR, TD, TH
Forms FORM, INPUT, TEXTAREA, SELECT, OPTION
Frames FRAMESET, FRAME META tags META

the element if what is contained with in.

Sara Victoria
Sara Victoria
1,249 Points

my understanding is an element is made up of an opening and closing tag.

Thanks for your answer but I think I'm still a bit confused

Sara Victoria
Sara Victoria
1,249 Points

for example... the tag <p> </p>are tags but the
<p> words in the paragraph </p> is the element.

Sara Victoria
Sara Victoria
1,249 Points

including the tags makes the element.

For example do you mean "<h1>" is a tag and "<h1>My name </h1>" is an element?

jondalar Lee
jondalar Lee
1,585 Points

The tag is the code that defines what type of element it is eg:

 <html>element</html>

tells the broswer that everything inside this tags is an HTML element. for self-closing tags the element is contained in the tag eg:

<img src="element">

.

An attrubute is code in a tag that discribes the element like an alt attrubute discribes the alternitive text to an image for blind people. eg:

<img src="element" alt="attrubute">

an attrubute is part of the tag but not part of the element.