There are many more tags than the basic ones discussed here. But all tags follow certain rules. Think of them as switches that you turn on and off. Close every tag just as soon as it has completed its job. Tags are closed in the reverse order from which they are opened.
Tags usually occur in pairs and are often nested, one pair inside another.
Read backward to the left to find the last tag you opened. Close it first. Then close the one before that, etc. Each pair of tags in the example below is a different color, so you can easily see the sequence in which they are opened and closed. Tags must tell the browser both what to do and how to do it.