Structure of HTML Document with Example



Structure of HTML

This is the basic template or piece of code which defines the structure of a HTML document.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> Document </title>
</head>
<body>

</body>
</html>

DOCTYPE: This defines the type of the document. Here in the example it defines that it is an HTML document.

html: This is the root element of any HTML document. It defines that from here you have to start writing HTML code.

meta element: It is used to provide the structured metadata about a webpage. 

head: This tag is used to contains the meta data which helps in SEO.

title: This tag is used to define the title of the web page. In the given code "Document" is title HTML document.

body: This tag contains all the content or data which will be displayed on the web browser.


What is Comment Tag in HTML?

Comment tag is used to add comments in the source code. The text inside comments will not be displayed in the browsers. Given code is used to add comment in HTML.

<!-- -->


Code Described in the video

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title> Tutorial 3 </title>
</head>
<body>
    Welcome to Complete Web Development Course
    <!-- This is a comment-->
</body>
</html>



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad