Advance HTML5 and HTML Interview Questions

HTML (HyperText Markup Language) is arguably the more widely-used & known programming language that’s utilized for web app development. HTML was made by Berners-Lee and was 1st published back in 1995. Moreover, HTML has evolved over the years and has received numerous releases. HTML is a normal text-formatting language utilized for developing web pages that are released back in 1993. Additionally, HTML is a language that’s interpreted by the browser & it communicates to the browser how and what to display.

Being an important language, therefore, HTML is among the best for one to have. Moreover, those that have the skills in HTML, can apply for their dream jobs. For you to be sure with the job, you need to have proper preparations. The article below will offer you some of the questions that you are likely to be asked when in an HTML interview Questions.

Advance HTML5 and HTML Interview Questions

What’s HTML?

HTML is a short form for HyperText-Markup-Language & it’s the language of the internet. It’s the standard text-formatting language that’s utilized for creating & displaying pages on the Internet. Furthermore, HTML documents are made up of elements & the tags which format it to properly show on pages.

What’s Tag?

An HTML tag is made up of 3 things. This includes an opening tag, content & and ending tag. Other tags are unclosed tags.

An HTML document needs to consist of 2 major things: This includes

  • Tags
  • Content

When a web browser reads an HTML document, the browser reads it from the top to the bottom & from the left to the right side. Additionally, HTML tags are utilized to makes HTML documents & render their features. Every HTML tags have various properties.

The Syntax is

<tag> Content </tag>

The content is positioned between tags which allow the display of information on a web page.

What are Attributes & how can one use them?

Every tag has extra attributes which change the manner the tag is displayed or behaves. For instance, a <input> -tag has a kind of attribute, which one can utilize to specify if it is a radio button, text-field, checkbox, or among more choices.

Attributes are stated directly after the name of a tag, inside the 2 angled brackets. The only need to appear in opening tags or at self-closing tags. However, they shouldn’t be in closing tags.

When are comments utilized in HTML?

Comments help one to understand the code. Comments can be added to the code to an HTML document. These aren’t displayed in a browser, but they assist one in leaving notes for the developers and yourself as to which section of HTML it’s for. Any start of comment is signified by <!– & the end is denoted by — >. Everything in the center will be fully ignored, even if it has valid HTML.

What’s formatting in relation to HTML?

HTML formatting is a way of format text for a good look & feel. It utilizes various tags which help in making text bold, underlined, and italicized.

What’s the void element in HTML?

HTML elements that doesn’t have closing tags or don’t need to closing are Void-elements. For instance <br />, <hr />, <img /> etc.

What’s the benefit of eliminating white space?

At HTML, a sequence of blank whitespace characters is regarded as a one space-character. The reason being the browser combines multiple spaces to a single-space character & this assists a developer to indent-lines of text minus worrying about numerous spaces & maintaining readability & understandability of HTML-codes

What’s a marquee in relation to HTML?

Marquee is utilized for scrolling text on a web page. This scrolls the picture or text up, left, right, or down automatically. To use a marquee, one needs to utilize the </marquee> tags.

Define list kinds in relation to HTML?

The list kinds in HTML are listed below:

  • Unordered list– Unordered list utilizes <ul> tag & displays elements with a bulleted format.
  • Ordered list– Ordered list utilizes <ol> tag & shows elements in a number format.
  • Definition list–definition list utilizes <dl>, <dd>, <dt> tags & displays elements in a definition form like a dictionary.

Describe the HTML layout format

All web pages have various components which allow them to display the planned content & a particular UI. Though still, there are little things that are templates & are accepted globally ways to structure web pages. These includes:

  • <header>: keeps the starting data about a web page.
  • <footer>: Represents the last part of a page.
  • <nav>: Navigation menu of HTML-page.
  • <article>: It’s a set of data.
  • <section>: It’s utilized in the article block which defines the basic format of a page.
  • <aside>: Sidebar page content

How can one create a hyperlink at HTML?

The HTML offers an anchor tag that forms a hyperlink which links a single page to a different page. The tags appear in one of the following methods:

  • Unvisited link – It’s displayed, blue and underlined
  • Visited link – It’s displayed, purple, and underlined
  • Active link – It’s displayed, red and underlined

What’s semantic HTML?

This is a coding-style which utilizes HTML markup in reinforcing the meaning or semantics of content. For instance with semantic-HTML <b> </b> tag isn’t used for bold-statement and <i> </i> tag isn’t utilized for italic. However, <strong></strong> & <em></em> tags are used instead.

Does a hyperlink just apply to text?

No. Hyperlinks are used on both images & texts. HTML anchor-tag describes a hyperlink which links a single page to a different page. “href” attribute is a more significant attribute of the HTML anchor tag.

What’s an image map?

Image-map enables one to link numerous different web pages using one image. It’s represented using <map> tag. One can state shapes in pictures that you need to make a section of image mapping.

What’s the basic structure of an HTML template?

The basic structure of the HTML template is:

<!DOCTYPE html>
<h1>My First Heading</h1>
<p>My first paragraph.</p>

What’s the HTML-article element?

HTML <article> Element states independent & self-contained content in some document, application, site, or page that’s independently reusable or distributable. Since it’s independent of a website or document, hence, it’s viewed, distributed, and reused separately.

For instance, syndication. HTML article-element is utilized in:

  • Blog post
  • Forum post
  • Newspaper article

How does one insert a picture in HTML?

Pictures can be inserted in HTML page though using <img> tags. It’s an empty tag that has just been attributed & it doesn’t need a closing tag. <img> tag needs to be utilized inside a <body><body> tag. The parameters below will be needed to insert pictures utilizing<img> tag

  • alt attribute – It’s for adding an alternate text.
  • src, attribute – It’s utilized for adding the path to an image.
  • Height – Adds height of pictures
  • Width – Adds the width of pictures

How does one insert a copyright symbol at HTML?

One can insert a copyright symbol with the help of &#169; or &copy; in an HTML file.

What’s SVG in relation to HTML?

HTML SVG is utilized in describing the raster or vector graphics. SVG pictures & their behaviors are stated in XML-text files.

Vector kind diagrams like 2-Dimensional-graphs in X and Y coordinate system and pie charts are used.

<!DOCTYPE html>
<svg height="100" width="100">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
  Sorry, your browser does not support inline SVG.  

How are nested web pages in HTML created?

Nested web pages essentially mean that a webpage is a webpage. Nested web pages can be created in HTML using an in-built iframe tag. HTML <iframe> tag outlines an inline-frame. For instance:

<!DOCTYPE html>
<h2>HTML Iframes</h2>
<p>You can also use the CSS height and width properties to specify the size of the iframe:</p>
<iframe src="demo_iframe.htm" style="height:200px;width:300px" title="Iframe Example"></iframe>

What occurs if one opens an external CSS file in a browser?

If one tries to open an external CSS file in a browser, a browser won’t open the file. The reason being the file has various extensions. The only way of using an external CSS file is by referencing it using <link/> tag in another HTML document.

What are the types of Doctypes available?

3 types of Doctypes available are

  • Transitional Doctype
  • Strict Doctype
  • Frameset Doctype

What is the importance of <head> & <body> tag in relation HTML?

<head> tag offers the data about document. This needs to be always to be enclosed inside the <html> tag. The tag consist of metadata about webpage & the tags that are enclosed through head-tag like <meta>, <script>, <link>, <style> etc. aren’t displayed on web page. Moreover, there can just be one <head> tag in a whole Html-document & will ever be before <body> tag.

<body> tag states the body of HTML document. This needs to be always enclosed in a <html> tag. Every contents requires to be shown on web page including images, audio, contents, text, video, utilizing elements like <img>, <p>, <audio>, <video>, <heading>, <div>, etc. This needs to be always being enclosed inside <body> tag. Moreover, there can just be one body element in a HTML document & will ever be after <head> tag.

What are permissible values of position attribute?

There are majorly seven values of position-attribute which needs to be utilized to a position HTML element:

  • absolute: The element is placed relative to the parent element. The last position is defined by values of right, left, bottom, or top.
  • static: Default-value. Here elements are positioned depending on the normal flow of a document.
  • fixed: it’s similar to absolute excluding here elements are placed relative to <html> element.
  • initial: Resets property to a default value.
  • relative: The element is placed according to the normal flow of the document & positioned relative to the original/normal position.
  • inherit: The element gets or takes the property of the parent

What does hierarchy do to the style-sheets follow?

If a single-selector includes 3 different kinds of definitions, a definition that’s closest to the actual tag gets precedence. Inline-style takes precedence over inserted style sheets, which take priority on external style sheets.

Can one change the hue of a bullet?

The hue of a bullet is ever the hue of the 1st text of the list. Thus, if one needs to change the hue of the bullet, he/she needs to change the hue of the text.

What’s the use of a span tag?

The span tag is utilized on the following things:

  • For adding-background on text
  • Adding hue on text
  • Highlight every color text

Explain why URL is encoded at HTML?

URL is encoded to change non-ASCII characters to a format that can be utilized over the Internet. The reason being a URL is sent via the Internet using an ASCII character set. Therefore the URL needs to consist of characters outside the ASCII set. The URL can be changed. Non-ASCII characters are substituted with “%” trailed with hexadecimal digits.

What’s the difference between meter and progress tag?

Progress tag is utilized in representing the progress of the task and the meter tag is utilized to measure data in a given range.

What’s the major difference between LocalStorage & SessionStorage objects.

localStorage object keeps the information without an expiry date. Moreover, sessionStorage-object keeps the information for just one session.

localStorage Example

<!DOCTYPE html>
<div id="result"></div>
// Check browser support
if (typeof(Storage) !== "undefined") {
  // Store
  localStorage.setItem("lastname", "Smith");
  // Retrieve
  document.getElementById("result").innerHTML = localStorage.getItem("lastname");
} else {
  document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage...";

With the localStorage object, the information won’t be deleted when a browser window closes. Moreover, the information gets deleted if the browser window closes, in the case of sessionStorage-objects.

<!DOCTYPE html>
function clickCounter() {
  if (typeof(Storage) !== "undefined") {
    if (sessionStorage.clickcount) {
      sessionStorage.clickcount = Number(sessionStorage.clickcount)+1;
    } else {
      sessionStorage.clickcount = 1;
    document.getElementById("result").innerHTML = "You have clicked the button " + sessionStorage.clickcount + " time(s) in this session.";
  } else {
    document.getElementById("result").innerHTML = "Sorry, your browser does not support web storage...";
<p><button onclick="clickCounter()" type="button">Click me!</button></p>
<div id="result"></div>
<p>Click the button to see the counter increase.</p>
<p>Close the browser tab (or window), and try again, and the counter is reset.</p>

Information in sessionStorage is available only in the current window of a browser. though, the information in localStorage can be shared in between several windows of the browser.


As an HTML expert, you shouldn’t miss that job up to this point. With the guide of the interview questions that you may encounter, you will have confidence and an idea of what you will get.

Doctype Html html5

How to define Head in HTML

What is HTML Elements in HTML5?

What’s Difference between HTML5 and HTML?

Leave a Comment