We discussed, html in detail and now you must be clear in hypertext or markup Language concept. Now we will discuss the Html page structure, it is same like, before construction we should be knowing map of our dream home.
Let us understand the Html page structure with the image, we at SharpLesson uses visual , because visual makes your understanding much sharp which is not the case with hard core reading.
It is quite clear, that Html page structure uses many and different tags. The main tags are, what we mentioned in the image. For best practice, we should not avoid any of these. Let me give you a brief idea, because later we will discuss each tag in detail.
Html (<html>) tag – It defines the root of an Html document.
Head (<head>) tag – It defines the information about the document.
Title (<title>) tag – It defines a title for the document.
Body (<body>) tag – document’s body comes here.
Html Page Structure – Example
Now we will use examples to understand the Html page structure. It will clear all your doubts regarding the use of the elements in the Html page structure. We have just taken a simple example, where we have used Html, head, title, body, and heading tags. These are the basic tag, and that is why we have taken very basic example to see the result.
<html> <head> <title>Sharplesson page</title> </head> <body> <h2>HI to everyone</h2> </body> </html>
When you will run this code, then the output will be:
HI to everyone
You can clearly see that we have used the basic Html page structure. You can’t omit any of the above tags. Yes, title tag you can take lightly that too when you are just testing or learning. Otherwise the title of pages is very important for SEO purpose.
We have just covered the Html page structure with an easy to understand example. For beginners, it is very important to understand and hold the roots. Otherwise, it will bother you later as an error in your coding.