HTML is written in a text editor, and looks a bit like this:
It might not look much like boxes, but rest assured—it is! If you look closely, you can see there are words and letters surrounded by “<” and “>”. These are called tags, which are HTML’s version of boxes.
The words inside the tags are the content of the box, and the tags themselves are the box’s walls. The tags also tell the browser what to do with the content inside them.
Each element has two tags: an opening tag and a closing tag. Closing tags have a “/” after the first “<”, while opening tags don’t. Opening tags can also contain more information for the browser about how the element should look and any special properties it should have.
For example, the opening tag for a paragraph is “<p>”, and the closing tag is “</p>”. The opening tag tells the browser to start a new paragraph, and the closing tag tells the browser to end the paragraph.
If you’ve ever made text bold in WhatsApp, you’re already more familiar with how tags work in HTML than you think!
But why do I keep talking about boxes?!