Explain what a <div> tag is to a non-programmer

Jameo picture Jameo · Dec 25, 2012 · Viewed 16.5k times · Source

So my brother is home for the holidays, and he is trying to learn HTML & Javascript. I've had some success explaining to him many of the concepts related to this. Most of the tags are pretty self explanatory, but I've struggled with describing a div tag.

To be honest, I never really got a good description for myself, just through experience I know when to use one.

A good answer will not need to include the definition of "block element" or any other technical jargon, although you can assume some basic knowledge of some HTML tags

Answer

samayo picture samayo · Dec 25, 2012

For some reason the purpose or logic around the <div> </div> tags, made sense to me looking at cloth clips, and the reason it is because:

  • Cloth clips are usually or almost always are applied Two for each type of cloth.(<div> </div>)
  • One can not work without the other, otherwise the cloth will fall. ex: <div> alone can not work.
  • The purpose of them is so that, they can hold a block of code ex: (a cloth in this case)
  • And control the structure, space, width, layout of a given object as per your desire.

enter image description here