HTML - Introduction
- HTML is used to create web pages and web applications.
- A static website can be created using HTML only.
- HTML describes the structure of a Web page.
- HTML is widely used language on the web.
- HTML consists of a series of elements and tells the browser how to display the content.
Basics of a HTML Document
The following is an example of a simple HTML document.
<!DOCTYPE html> <html> <head> <title>This is document title</title> </head> <body> <h1>This is a heading</h1> <p>Hello World!</p> </body> </html>
The output of the above code will be:
Lets break down this example to learn basic concepts of HTML:
HTML uses tags to format the content. These tags are enclosed within angle braces <Tag Name>. Apart from few exceptions, most of the tags have their corresponding closing tags, for example, <html> has its closing tag </html> and <head> tag has its closing tag </head> tag etc.
An HTML element is everything from the start tag to the end tag:
|Start tag||Element content||End tag|
|<title>||This is document title||</title>|
|<h1>||This is a heading||</h1>|
HTML Page Structure
A typical HTML document can be visualized with the following page structure: