• Check out world news on HeadLinesList.com
  • Forum registration is now open for public.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the difference between an HTML element and an HTML container?
#1
From what I understand:

An HTML tag, with opening and closing tags, define the start and end of an element.

An HTML container can contain relevant tags but are also defined by HTML opening and closing tags, so a div container is anything inside.

<div></div>

But isn't that the same as an HTML element? Do they refer to the same entity?
Reply

Ads

#2
yes HTML container is similar to DIV tags which are the open and closing </>. Just imagine HTML is a big box(container) and DIV is a smaller box in it.
Reply

Ads

#3
They're both tags and elements but each has a use. A container doesn't describe the content. For example, a <p> element is used to let the computer know that the content is a paragraph. Containers like <div> and <span> have no special meaning and are used for presentation purposes. A <div> might be used to contain several paragraphs into an article and <span> might be used to highlight the title of a book within a paragraph.

– Dominic
Reply
#4
a few HTML5 elements are containers, their purpose is simply to group other elements for styling purpose, interactivity purpose, or other purposes
see a demo for the div element:
http://w3-video.com/Web_Technologies/HTML5/html5_div_tag.php

"An HTML container can contain relevant tags" = not relevant tags but the allowed tags
e.g. see the allowed children of the head container for example
http://w3-video.com/Web_Technologies/HTML5/head/html5_head_tag_nested.php
http://w3-video.com/Web_Technologies/HTML5/html5_head_tag.php
Reply

Ads

  


Forum Jump:


Browsing: 1 Guest(s)