HTML – Introduction
Basic of HTML
HTML is a HyperText Markup Language. It is a primary language of the World Wide Web(WWW) and it is used for making and designing web pages. These Web Pages supported by web browsers to display a standard static HTML document on the web. The Static document means whatever the content placed in the document that will not change. Whereas Dynamic documents are those documents where the data or content will change after some intervals or because of any action. The current version of Html is Html 5.
Example:
Static – Any Document or Web Page with fixed content like – About Us page on any website with details about the company/website.
Dynamic – Any Document or Web Page with continuous updates or data change after a time interval like- News and Sports websites update their page continuously.
The File Extension of any HTML document is “.html” or “.htm”.
How to Code in Html?
HTML can be code in any Text Editor like – Notepad, Sublime, Notepad++, VS Code, etc.
Let’s make a Namaste program in HTML using notepad.
Steps for Namaste Program:
Step 1 – Open Notepad or any text editor then type the code given below.
<!DOCTYPE html> <html lang="en"> <head> <title>My First HTML Program</title> </head> <body> Namaste </body> </html>
Save the file with the “.html” extension.
Click to open the file in a browser.
Output in the Browser will be like.
Namaste
Explanation about code.
Here the opening and closing tags are HTML.
<html lang="en"></html> where the lang is an attribute used for making the page content a language specified. It helps in identifying the language of the web page content like- for English lang = en.
The Head tag always used under and after the HTML opening tag and it is closed before starting the body tag. It is referred to as a section in the HTML document and this section contains metadata description, external links of sources files like style sheet, or any javascript file.
<head> </head>
Here the title tag is placed between head tags. The title tag defines a document title in the browser tab. After that Body tag is used for the main content block of the web document. It always placed after the head section and close before closing the Html tag.
<body>Namaste</body>
Comments
comments in the HTML documents are used for making the code section simple. Anything which is set as a comment in the HTML code will not display as a result or will not read by the browser. They help in hiding the unwanted code at a point of time and make your source code easier to understand like checkpoints or checkmarks.
<!DOCTYPE html> <html lang="en"> <head> <title>My First HTML Program</title> </head> <body> <!--This is a single line comment section--> Namaste <!--This is a multi-line comment code inside a comment block/section will not read by the browser --> </body> </html>
The doctype is placed at the beginning of the HTML document which specifies the document type to the web browser.
<!DOCTYPE html>
Doctype is not case sensitive and it is a standard representation of dynamic and document type definition (DTD).
Next Topic – HTML Tags