In this section we will see some basic html tags which define the structure of HTML document and divide it into various parts. There are several html tags like <html>,<head>,<body> which help to organize and format the elements in our webpages in a simple way. Now we will discuss these basic tags one by one which are common and base of each html document.
HTML Document
Basic html document contains following tags:
- <!DOCTYPE html>: All html documents usually start with this tag, it inform the web browser about the document type and html version. Using this tag is not necessary, but adding this tag is good practice because it inform the web browser about document type. It starts with <!doctype html> and does not include closing tag.
- <html>: It is important to enclose any html code in this tag. It starts with <html> and finishes with tag </html>.
- <head>: This tag contain all header information of webpage or document. HTML head starts with <head> and finishes with tag </head>.
- <title>: We may use this tag to mention the title of webpage as the tile is information about header so we will use this tag within <head> .It starts with <title> and finishes with tag </title>.
- <body>:Of all tags the body tag is most important tag as it contains the page actual body which is shown to all users. Whether it is text, picture ,video, link or any material comes under this tag. It starts with <body> and finishes with tag </body>
<!DOCTYPE html> <html> <head> <title>Example</title> </head> <body> <p>Welcome to tutorials art</p> </body> </html>