HTML Topic 1
HTML stands for Hypertext Markup Language, and it is the most widely used language to write web pages.
Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers.
Now, HTML is being widely used to format web pages with the help of different tags available in the HTML language.
Basic HTML Document
In its simplest form, the following is an example of an HTML document:
<!DOCTYPE html>
<html>
<head>
<title>This is the document title</title>
</head>
<body>
<h1>This is Heading</h1>
<p>Document content goes here ...</p>
</body>
</html>
Now, after writing this all in your file, save it as test.html on your computer or upload the same on your server and see how it works.
HTML Tags
As told earlier, HTML is a markup language and makes use of various tags to format the content. These tags are enclosed within angle braces <Tag Name>. Except for few tags, most of the tags have their corresponding closing tabs. For Example, <html> has its closing tag </html> and <body> tag has its closing tag </body> tag etc.
The above example of HTML document uses the following tags:
To learn HTML, you will need to study various tags and understand how they behave while formatting a textual document. Learning HTML is simple as users have to learn the usage of different tags in order to format text or images to make a beautiful webpage.
HTML Document Structure
A typical HTML document will have the following structure:
Document declaration tag
<html>
<head>
Document header related tags
</head>
<body>
Document body related tags
</body>
</html>
We will study all the header and body tags in subsequent chapters, but for now, let's see what is document declaration tag.
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document.
<!DOCTYPE html>
There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE ...> tag along with other HTML tags.