HTML 1.0: It was the first release but had very limited usage.
HTML 2.0: Released by adding some new features to HTML 1.0, this was the standard application for website development.
HTML 3.0: Due to improper standards of the existing version of HTML, popular browser developer Netscape Navigator had some of its own tags. This is when HTML 3.0 was introduced.
HTML 3.2: This version stopped the non-standardized HTML by introducing World Wide Web Consortium (in short W3C) to keep the language standardized.
HTML 4.0: Created an evolution as the browser support was undertaken by Microsoft in their Internet Explorer (IE).
HTML 5.0: The current version of HTML which was introduced especially to work with any type of devices like mobile, tablets, large monitors etc.
Difference between HTML4 and HTML5
1. What is the need of mentioning <!DOCTYPE HTML> at the beginning of an HTML page?
The <!DOCTYPE HTML> indicates the version of HTML which in this case is 5. The earlier versions like HTML4 were based on Standard Generalized Markup Language (SGML) and required a Document Type Definition (DTD). HTML5 however, is not based on SGML and doesn’t need a DTD.
2. List out the new Structural Elements in HTML5.
HTML5 introduced few structural elements to define different parts of a web page like article, header, footer, main, mark and many more.
These are sections in which a web page is usually divided into. In HTML4, the same was implemented using div with an id/class name to it.
3. Define Meta tags.
Meta tags are the tags that provide more information to our web pages. Some of the tags that are examples for meta are:
- Link: Defines a relation between the web page and an external source.
- Style: Inserts styles (CSS) details to the web page.
- Title: Provides a title to the web page.
4. How is it possible to insert a copyright symbol in a web page?
As there is no direct key to type and insert the copyright symbol in a web page, it has to be given by combining different characters. This can be done in multiple ways like:
- & #169.
5. List the API’s available in HTML5.
The HTML5 standard introduced a number of new APIs. Here is a small list:
- Constraint Validation API
- Text Track API
- Media API
- Command API
- User Interaction
- Data Transfer API
- History API
- Application Cache API
6. Why Meta tags are used in HTML?
Answer: Meta tags in HTML are used by the developer to tell the browser about the page description, author of the template, character set, keywords and many more.
Meta tags are used for search engine optimization to tell the search engine about the page contents.
content="width=device-width, initial-scale = 1.0">
content="HTML interview questions">
content="All Rights Reserved">
7. Explain list elements in HTML.
Answer: Enlisted below are the list elements in HTML:
- Ordered List (<ol>) – An Ordered List or ol tag is the list that lists the items in an ordered way, i.e. numbered or alphabetically.
- Unordered List (<ul>) – An Unordered List or ul tag is the list which will list the items in an unordered way, i.e. in bulleted format or in any other format.
- Definition List (<dl>) – A Definition List or dl tag arrange the items in the way in which they are arranged in a dictionary.
8. How can we create a hyperlink in HTML?
Answer: An anchor tag or <a> tag in HTML is used to create hyperlinks. This creates a path between two different HTML web pages.
Hyperlinks can be displayed in three ways:
- Unvisited Link – These links are blue in color and underlined.
- Visited Link – These links are purple in color and underlined.
- Active Link – These links are red in color and underlined.
9. Why do we use the required attribute in HTML?
Answer: The required attribute is used in HTML to make the field mandatory. It forces the user to fill that particular field to submit the form.
If the field is input then it will throw a default HTML error.
10. Explain new form elements in HTML5.
Answer: The new form elements that were added into HTML5 are:
- Datalist – It’s used as a list of options for input control.
- Keygen – This tag defines a key-pair generator (Private/Public) field.
- Output – It’s used to show the result of a calculation.