HTML tags are the hidden keywords within a web page that define how your web browser must format and display the content.
Most tags must have two parts, an opening and a closing part. For example,
<html> is the opening tag and
</html>is the closing tag. Note that the closing tag has the same text as the opening tag, but has an additional forward-slash ( / ) character. I tend to interperet this as the “end” or “close” character.
There are some tags that are an exception to this rule, and where a closing tag is not required. The
<img> tag for showing images is one example of this.
Each HTML file must have the essential tags for it to be valid, so that web browsers can understand it and display it correctly.
The rest of the HTML file can contain as little or as many tags as you want to display your content.
Some essential tags for html
- Definition –
- This basically defines the document as web page. It also identifies the beginning and end of the HTML document. All other tags must fall between the
- Header –
- The header contains information about the document that will not appear on the actual page, such as the title of the document, the author, which stylesheet to use and also meta tags.
- Title –
titletag defines the title that will appear in the title bar of your web browser. The
titlemust appear between the
- Body –
bodytags contain all the information and other visible content on the page. All your images, links and plain text must go between the
These four tags are special. There must only be one set of each and they must be in the correct order like in the example below. The fun and creative part comes when using the basic tags for adding content and headings.
Below is a basic html document. Notice that everything falls between the
html tags, the
title appears within the
head of the document, and that the
body comes after the
<html> <head> <title>My Page Title</title> </head> <body> This is where all my web page content goes! </body> </html>