Structure of an HTML page
Explaining the basic html structure
This is the basic structure of an HTML page:
<html> <head> Information about the page </head> <body> Content of the page </body> </html>
As we can see, the entire page is enclosed inside an <html> ... </html> tag. Inside this tag, there are two main sections. The section inside the <head> ... </head> tag contains information about the page like the title and the keywords. The section inside the <body>... </body> tag contains the material to be displayed on the page.
Here is another piece of code:
<html> <head> <title>My First Page</title> </head> <body> <h1>This is my first page</h1> <p>I am learning HTML. This is my first page.</p> </body> </html>
In the above example, we have used `tags' and `elements'. The statement:
<title>My first page</title>
will display the title `My First Page' in the title bar of the browser. Here, <title> is the opening tag and </title> is the closing tag. Inside, the sentence - My first page - is an element.
In the body section, the first statement is a heading tag, enclosed inside the <h1>...</h1> tag. The second statement is a paragraph tag, enclosed inside <p>...</p>.
The entire HTML is made up of such tags. If we understand the use of different tags, we can create simple HTML pages. We must remember though, that there is more to an HTML page than just the tags. Professional developers use HTML along with several other technologies like CSS (Cascading Style Sheet) and JavaScript to develop web pages.