Zebra0.com

html5HTML Tags

HTML Tags

Each element on a page is identified by a tag.
Tags are always inside < and >
Most elements also have a closing tag that is just like the opening tag except with </ instead of just <.

In the HTML below, notice the <html> tag on the second line and the closing </html> in the last line.

The next element is the head: it has an opening tag <head> and a closing tag </head>

Completely enclosed inside the head element is a title element.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HELLO WORLD</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>

Most web pages have many, many elements. One element can be nested completely inside another element as shown below:
nested tags

However, one element can not span two separate elements. In the illustration below the yellow box is not a valid element because it is half in the element shown in blue and half in the element shown in red.
bad element

Next: More Tags