HTML- Hypertext Markup Language is a markup language used to instruct browser how to structure its elements of webpages. HTML use tags to enclose or wrap different part of content to make it looks in certain desired way.
For example: This how it looks to viewer.
HTML is not a programming language
Below is the actual HTML document for above example.
<p><strong>HTML</strong> is not a programming language</p>
HTML elements are the building blocks of a webpage. The tags <p></p> are used to tell browser content is a paragraph and <strong></strong> to make enclose content bold. Whole together is called an element. This tags and elements are not displayed by browsers directly, but use them to interpret the content on the page.
From our example we have four things to know which are:
- Opening and Closing tags: Tag at start of the element (in this case, <p>, <strong>) enclosed in angle brackets used to instruct from where the effect of tag should start are called Opening tag and tags at the end of the element (</p>, </strong>) which used to stop tag effect on content are called Closing tag.
- Content: content is what tags enclosed around. From above example it’s a text and it can be image also.
- Element: All together that is opening tag, closing tag, content is called Element.
Note: Misplaced closing tag is a common error in beginners can lead to strange results.
Tags are not case-sensitive, they can be written in both uppercase and lowercase like <strong>, <Strong>, <StrONG>, <STRONG> all are same. For best practice it is recommended to write all tags in lowercase for consistency and readability.
Originally, HTML was created by Tim Berners-Lee in 1991 to define the structure of documents like headings, paragraphs, lists etc. to ease the process of sharing of scientific documents between researchers. Now, it is widely used to format web pages using different tags available in HTML.