html Interview Questions

An Overview of HTML

HTML refers for Hypertext Markup Language, which is a text-based approach to describing how content is structured in an HTML file. HTML is not a programming language. It just tells a web browser how to structure content, graphics, and multimedia on a web page. Commonly used HTML tags include h1; h2; div; table; and form etc. The most significant advantage of HTML is that it comes with in-built tools for creating responsive websites as well as interface components. We have an impressive collection of HTML Interview Questions and Answers that is a must read for all developers and designers!

Development History: Tim Berners-Lee was the primary author of HTML. The first version of HTML was published in June 1993.

Key points about HTML:
  • HTML is the building block for developing websites.
  • Universally accepted standard for making sure search engines can find your web pages on relevant searches.
  • HTML tags are case-insensitive.
  • Browsers use HTML tags to render the content of the web page.


Latest Version: HTML5 is the newest version.

Are you looking to impress your boss and grab the upcoming promotion at work? Here are the most common HTML interview questions to help you do that.

Advantages of HTML
  • Offers SEO benefits.
  • HTML is widely used and supported by most browsers.
  • HTML 5 Provides us storage options are more reliable.
  • It is not a proprietary code, so you do not need to pay a royalty for using it.
  • Coding is simple, clear and consistent. Even new programmers can use it with ease.


These HTML interview questions will help you prepare for your upcoming job interview as well and fast-track your career. Whether you are a fresher or an experienced HTML developer, these  Questions & Answers are all you need to succeed in your next interview.

We have an extraordinary collection of HTML 5 interview questions and CSS interview questions, Javascript interview questions, and Jquery interview questions.

html Interview Questions and answers

Looking for a new job? Do not miss to read our html Interview Questions and answers. Whether you are a fresher or an experienced, these questions and answers that can help you to crack your interview.

HTML is a language of www (world wide web). It is a text formatting language that gives us webpage structure. HTML elements are represented by tags. HTML is used to make interactive and dynamic websites — all web pages created by HTML tags.

HTML Stands for Hypertext Markup Language, and Berners Lee created it in 1991.

This is not an html tag. The <!DOCTYPE> syntax should be the first thing in HTML page, before the <html> tag. It is an instruction to the web browser about what version of HTML the page is written in. In HTML 4 we used <!DOCTYPE HTML PUBLIC ‘-//W3C//DTD HTML 4.01//EN’ ‘http://www.w3.org/TR/html4/strict.dtd’> But now in HTML 5 we used only <!DOCTYPE html>

HTML Heading tags can be used to define as a title or a subtitle which you want to display on your page. When you place the text in the heading tags <h1> This is your page title</h1>, These heading tags displayed on the browser in the bold format and size of the text depends on the number of heading.

There are six different HTML headings which are defined with the <h1> to <h6> tags. h1 is the largest heading tag, and h6 is the smallest one. So h1 is used for most important heading, and h6 is used for least important.

Advantages of HTML:
  • HTMl is widely used.
  • Every web browser supports HTML language.
  • It is easy to use and learn.
  • It is by default in every window, so you don't need to purchase extra software.


Disadvantages of HTML:


  • HTML is used for a static web page, not for dynamic
  • Need to write a lot of code for making a simple webpage.
  • Security features are not useful in HTML.

HTML 5 is the latest version of HTML

<form> tag are used to making forms on web pages. These forms are used to interact directly with users. Its elements are different types of input, like text fields, checkboxes, radio buttons, submit buttons and more. Attributes of these <form> tag are action, method, name, class, id, etc. The <input> tag can be displayed in many ways, depending on the type attribute.




First name:

<input type="text" name="First_name">

Last name:

<input type="text" name="Last_name">


In HTML, Lists are used to specify lists of various types of information. All records items may contain one or more elements.

Types of HTML lists are listed below:
  • Ordered List(ol)
  • Unordered List(ul)
  • Description List(dl)



// Ordered List

  1. Best
  2. Interview
  3. Questions

// Un ordered List

  • Best
  • Interview
  • Questions

In HTML, <table> tag is a block elements used to create a table. It is useful when you want to represent data using rows and columns. The basic elements that make up a table include <th>, <td>, and <tr>.

No, there are some HTML tags that do not need a closing tag. Examples are the <img> , <br>, <hr> tags

It is a process of formatting text for a much better look and feels. There are various formatting tags available in HTML. These formatting tags are used to make text bold, italicized, or underlined. There are 12 options available that how text appears in HTML pages.

There are 12 HTML formatting tags are listed below
  • Bold Text If you write anything in between <b>............</b> tag, is shown in bold letters.
  • Italic Text If you write anything in between <i>............</i> tag, is shown in italic letters.
  • HTML Marked formatting If you want to highlight text in a webpage, you should write the content within <mark>....</mark> tag.
  • Underlined Text If you write any text within <u>.........</u> tag, is shown in highlighted text.
  • Strike Text Anything written in between <strike>....</strike> tag is displayed with strikethrough the page. It is a type of thin line which crosses the statement.
  • Monospaced Font If you want the same width of every content then you should write the text in between <tt>.............</tt> tag.
  • Superscript Text If you put the text in between <sup>..............</sup> tag, is shown in superscript. It is displayed half a character's height above the other characters.
  • Subscript Text If you put the text in between <sub>..............</sub> tag, is shown in subscript. It means is displayed half a character's height below the other characters.
  • Deleted Text Anything that puts within <del>..........</del>tag is shown as deleted text.
  • Inserted Text Anything that puts in between <ins>.....</ins>tag is displayed as added text.
  • Larger Text If you want to put font size more significant than the rest of the page text then put the text in between <big>.........</big> tag. It increases one font size more significant than the previous one.
  • Smaller Text If you want to put font size lower than the rest of the text then set the text in between <small>.........</small> tag. This tag helps in to reduce the font size.

Semantic HTML tags are just a coding style. It is the use of HTML to reinforce the meaning of the text.

For example: In this <b> </b> and <i> </i> tag is not used. Instead of these we can use <strong></strong> and <em></em> tags.

<iframe> is used to display a nested web page. In other words, <iframe> represents a page contents within a page. The HTML <iframe> tag defines an inline frame



<iframe src="https://www.bestinterviewquestion.com"></iframe>

HTML tag attributes are used for add additional functionality. Attributes like id, class, style, lang, title etc

<img> tag are used to show image in web page. <img src=" https://www.bestinterviewquestion.com/public/frontend/img/b2.jpg" alt="Blog Image"/> Attributes of this tag is width, height, class, alt, id etc

HTML elements with no text or content are called empty elements. For example: <br>, <hr> etc

The span tag is used for the following things

  • For adding color to text
  • For adding background on text
  • Highlight any color text



<span> This is a example of span tag. </span>

It is a simpler doctype declaration is just one of the many novelties in HTML5. Now have to write only: <!doctype html> and this is it. But in HTML4 we used <!DOCTYPE HTML PUBLIC ‘-//W3C//DTD HTML 4.01//EN’ ‘http://www.w3.org/TR/html4/strict.dtd’> In HTML5 we used various new tags like : <footer>, <header>, <video>, <audio>, <section>, <article>, <figure>, <center> etc

Reset and submit button both are using within <form> element. Reset is used for reset the form. It means clear the form and Submits is used to present the form data.

The new input types for form validation are email, URL, number, tel, and date. With the help of the required attribute, it will work. Also if we want specific validation, then we have to add input type "text" or "email" or "tel."

<!DOCTYPE html>
<meta charset ="UTF-8">
<title>Best interview questions</title>
<header> <nav></nav> </header>








The meta tag is information about data. Metadata will not be displayed on the application, but it will be machine parsable. These elements are typically used to specify page description, keywords, page title, author name of the document, and other metadata.

The metadata is used by web browsers (how to display content or reload the page), search engines (keywords), or other web services.



<meta name="description" content="Best Interview Questions">
<meta name="keywords" content="Interview questions, php interview questions, html interview questions">
<meta name="author" content="Best Interview Questions">


It is used to explain the two-dimensional vector and raster graphics. SVG images and their behaviors are defined in XML files. So as XML files, you can create and update SVG image with the text editor. It is mostly used for vector type diagrams like pie charts, 2-Dimensional graphs in an X, Y coordinate system.

You can add a copyright symbol on your webpage by using © or © in an HTML file.

<marquee> is used to put the text scrolling which is in scrolling mode on a web page. It scrolls the text or images up, down, left or right automatically. You have to put the content which you want to scroll in between the <marquee>......</marquee> tag.

No. Typical HTML4 Typical HTML5
1) <div id="header"> <header>
2) <div id="menu"> <nav>
3) <div id="content"> <section>
4) <div id="post"> <article>
5) <div id="footer"> <footer>

In HTML page comments begins with “<!–“ and ends with “–>.”

There are lots of new elements are using in html5 that are given below:-

  • Color
  • Date
  • Datetime-local
  • Email
  • Time
  • Url
  • Range
  • Telephone
  • Number
  • search

White spaces are a new sequence of space characters, which is treated as a single space character in HTML. Because the browser collapses multiple areas into a single space, we can indent lines of text without worrying about various fields. It enables you to organize the HTML code into a more human readable format.

Image map lets the user link to many different web pages using a single image. We can define shapes in pictures that we want to make part of an image mapping. It is the process of establishing unique ways inside a photo and links it to different destinations.

More Relevant Interview Questions & Answers

Stay updated with the coming world

Oops Interview Questions and Answers in Php, C++,...


Laravel is a free and open-source PHP framework...


WordPress the most popular content management system (CMS)...


Yii is a component-based, high-performance PHP framework for...


Drupal is an open source PHP content-management framework...


Joomla is a free content management system (CMS)...


CakePHP is a modern, open-source PHP 7 framework...


CodeIgniter is a PHP open-source web development framework...


Yii 2.0 is a component-based and high-performance PHP...


Laravel 5 is robust and follows the MVC...


Licensed under the New BSD License, Zend Framework...


Zend Framework 2 Interview Questions and Answers for...


Symfony is one of the most widely used...


Magento is an open-source PHP e-commerce platform. Magento...


An open source and PHP-based, OpenCart is an...


PHP Arrays are the most important feature in...


PHP earlier stood for Personal Home Pages, but...


React Interview Questions - React Interview Questions and...


JavaScript is a high-level programming language that is...