Special Offer - Enroll Now and Get 2 Course at ₹25000/- Only Explore Now!

All Courses
HTML Interview Questions and Answers

HTML Interview Questions and Answers

February 28th, 2019

HTML Interview Questions and Answers

In case you’re searching for HTML Interview Questions and answers for Experienced or Freshers, you are at the correct place. GangBoard offers Advanced HTML Interview Questions and answers that assist you in splitting your HTML interview and procure dream vocation as HTML Developer. HTML interview questions furnished below are much needed for beginners and experts to get through various levels of interviews. The highly experienced trainers in the training institute have prepared the below set of questions by gathering many information’s from various companies. The previous interview question papers are thoroughly analyzed, and the trainers have come up with only important questions to prepare. The questions are intended in a way to get prepared and get a highly paid job with an ease. The questions prepared are based on the important concepts of HTML language including hyperlinks, tag creation, tabular concepts, page design, HTML elements, nested web creation, layout, etc. Various IT professionals like Test Engineers, Developers, and Web Designer are in high need with HTML knowledge.

Q1) What is HTML?

Answer: HTML refers to: high text index language. That is, an HTML document written in simple text is used to describe the structure and content of webpages with links to other pages and resources.

Q2) What are difference between HTML elements and tags?

Each section of the web page, paragraph, a picture, a link or something you can communicate with is an element. Each type of element has its own behavior – for example you can click links, or type in text boxes.
An HTML document is a simple, simple text document, which can be opened with any text editor on your computer. When you open one, the document is made up of tags, each of which describes the HTML angle is surrounded by angled brackets. Here you can see the HTML tags for the browser that provides the text element inside:
<span> This text is surrounded by HTML tags! </ span>
Most tags open and close the tags. The opening tag is written with tag name in angle brackets, such as <Tagname> while the closing tag adds a perspective slash: </ tagname>. Anything between these start and end tags is considered to be the content of that tag.
Some tags, such as the <img> tag are automatically closed. This means they have no content. For example, an image can not contain additional HTML elements. The only way to change their behavior or appearance is by attributes or CSS.

<img src = "http://placekitten.com/200/300" />


Q3) What are some of the common lists used when designing a page?


  • sorted list
  • Unordered list
  • Definition list
  • Menu list
  • directory listing

Q4) What properties do you use?

Answer: Each tag can have additional attributes that change the way the tag works or changes. For example, a <input> tag has a type attribute, which you can use to specify a text field, a check box, a radio button, or a number of other options.
In the two angle brackets, the tags are named after attributes. They will always open tags or self-end tags to appear – they can not close tags. In a double quotation, a signal is equal to the selected value. “Take without any gaps before and after the equivalent note! Many attributes can be defined in a single note.

<! - Text Field ->
<input type = "text" />
<! - Archive ->
<input type = "checkbox" />
<! - radio button ->
<input type = "radio" value = "on" />

Each imagery is in every style – similar to style – however, most tags have their own particular ones, and those attributes are different type of tags (simply a picture molecule character paragraph tag).

Q5) What do you know about HTML5?

Answer: Throughout web history, there are many versions of HTML data. The versions differ in features and how tough it is. In 2014, official recommendation for HTML5 was published by the Global Web Confederation. This is a living standard, that is, to add new features over time.

Q6) What new features were added to HTML5?

Answer: It introduced several semantic components, which refers to the elements that express the meaning. Some of the new semantic components are <header>, <footer>, <section>, and <article>. That means they are not in simple containers, but they tell the browser more about their contents.
There are additional form element types such as “Number”, “Date”, “Calendar” and “Range”. Video and audio elements are included, and new graphic elements like <svg> and <canvas> have been added.

Q7) How do you use JavaScript on a web page?

Answer: To add interactive capabilities to your page, you’ll need JavaScript here, except already provided with HTML. This is a scripting language that allows you to interact with certain elements of the page, based on user input. With CSS, there are three main ways here:
In line
Specific HTML elements allow you to run a section of JavaScript while performing a specific event. For example, clicking on a button allows the script to run. These events are accessed by attributes and vary based on the events available for each element. The following example shows a warning of a message when the user clicks on it.

<button onclick = "Warning ('You clicked me!');"> Click Me! </ button>


A script module

Until the browser document reaches the part of the document, you can define a script package wherever you are. Note that this may be inside the <head> or <body> section of your document.

var x = 5;
var y = 6;
var result = x + y;
Warning ("X + Y Equals" + End);


Link to the JavaScript file

Again, like CSS, this is the preferred method here. This allows the content of the page to keep users content how they relate to content, and allows them to load the same script on multiple pages. Just like the script module, you can load the JavaScript file from <head> or <body>, but we will load it in the order in which your document is configured.

<script src = "my-code.js"> </ script>


Q8) Define iframe in HTML.

Answer: Iframe tag is written as <iframe>.
An iframe is used to display different document content within different document content in a rectangular area of the browser. If the different document content is embedded in the current HTML content, it is known as inline illumination.
The Src attribute contains the path of the document that occupies inline intercoms.

<! DOCTYPE html>
<Title> HTML Interview Questions with Frames </ title>
</ Head>
<p> iframe HTML code </ p>
<iframe src = "demo_iframe.htm" width = "300" height = "300">
Sorry your browser does not support inline frames.
</ Iframe>
</ Body>
</ Html>


Q9)  How can you create a hyperlink in HTML?

Answer: An anchor tag in HTML or <a> tag is used to create hyperlinks that create a path between two different HTML webpages.
Hyperlinks can be shown in three ways:

  • Unvisited link – These links are color blue and underscore.
  • visited link – These links are purple and colored in color.
  • Active link – These links are red and underscore of color.

Q10) Do we use the necessary attributes in HTML?

Answer: Use the required command in HTML. It encourages the user to fill out a specific domain to submit the form.
Field input means it will throw a default HTML error.

<input type = "email" name = "user_email" />

Q11) How can we add Google Maps to a website?

A: HTML Google maps let’s display Google maps on our webpage:

<! DOCTYPE html>
<h1> Google Interview Questions Google Map </ h1>
<div id = "map" style = "width: 400px; height: 400px; background: yellow">
</ div><script>
My Map () {
var mapOptions = {
Center: New google.maps.LatLng (51.5, -0.12),
Zoom: 10
var map = new google.maps.Map (document.getElementById ("map"), mapOptions);
</ script>
<script src = "https://maps.googleapis.com/maps/api/js?
</ script>
</ body> </ Html>


Q12) Difference between HTML and XHTML.

Answer: Differences in HTML and XHTML are as follows:

  • HTML is the HyperText Markup Language, the XHTML Extensible Markup Language.
  • A standard web page is an HTML web page and dynamic web pages are XHTML.
  • XML is harder than HTML.
  • HTML’s XML application is defined as XHTML.
  • All modern browsers support XHTML.

Q13) What is SVG element?

Answer: SVG is followed by the XML format; It has scalable vector graphics used to create vector graphics with interactive and animated support.
Resolution is independent of SVG because it does not lose its size or rearrange its quality.

Q14) What is HTML5 in quirks mode?

Answer: In our HTML page or in the document <! The DOCTYPE> element goes back to Quirks mode. In this mode, the HTML element is based on the browser.
So content will be displayed in accordance with the browser.

Q15) What is a picture diagram?

Answer: Image Map allows you to connect to various web pages using a single image. You can define the forms of images that you want to make part of the map mapping.

Q16) How do you add a copyright icon to the browser page?

Answer: To insert a copyright icon, you need to copy and copy it; Or & # 169; In an HTML file.

Q17) Old HTML files will work in newer browsers?

Answer: Yes, older HTML files are compatible with HTML standards. Most older files work in new browsers and some features will not work.

Q18) What is the use of combining multiple check boxes?

Answer: While checkboxes do not harm each other, they help integrate vertical boxes to integrate them. The test box buttons have their name and do not need to belong to a group. There are many other cabinets on the single web page.

Q19) What happens when you set up tags?

Answer: HTML Tags If the two sets are overlap, the first tag will only be recognized. You see this problem when the text browser does not display properly on the screen.

Q20) What are applets?

Answer: Apple is small programs that can be embedded into webpages to perform certain functions, such as computer, animation and information processing. Apple is written using Java language.

Q21) What is the difference between directory and menu lists and unordered lists?

Answer: The main difference is that directory and menu lists do not have attributes to change bullet styles.

Q22) Can the color of the bullets change?

Answer: Bullet color is always the first character in the list. With the first character with the <li> <font> and <font> <font> tag, the color attribute package, the bullet color, and the first character text will be different color.

Q23) What is Text Field Size Limits?

Answer: The default size of the text field is 13 characters. However, if the size attribute is included, the value can be less than 1. Maximum value is determined by the browser width. If the size attribute is set to 0, the size is set to the default size of 13 characters.

Q24) What is a Marx?

Answer: A Marquee allows you to place a scrolling text on a web page. To do this, place the text of what you appear to be scrolling in the <marquee> and </ marquee> tags.

Q25) How is the text in the web page that allows you to send email if you click?

Answer: To change the text of a clickable link to send e-mail, use the mailto command in the href tag. The form is as follows:

<Href = "mailto: youremailaddress"> click to click </a>


Q26) What is the sequence that follows when practical sheets arrive?

Answer: If a single selector has three different style definitions, the definition near the actual tag is the priority. Inline style takes priority over embedded style sheets, which gives priority to external style sheets.

Q27) What if you open an external CSS file in a browser?

Answer: When you try to open an external CSS file in a browser, the browser file can not be opened because the file has a different extension. The only way to use an external CSS file is to use the <link /> tag in another HTML document.

Q28) <figure> What is HTML5?

Answer: This tag refers to the content of the self-contained flow. It is often used as single units to indicate the main flow of the document.

Q29) What is the canvas element application?

Answer: The Canvas element helps create maps, maps, photoshoppad 2D images and helps them keep them directly in HTML5 code.

Q30) Tell me two advantages of HTML5 web storage

Two main advantages of HTML5 Web Storage are:

  • It can save up to 10 MB data, which is definitely more than what cookies are.
  • Web Storage Data can not be changed with HTTP request. It helps to increase the performance of the application.

Q31) What are the two types of web storage in HTML5?

Two saving types of HTML5:
Session Saving:
This only stores current session data. Data stored in session storage automatically will be automatically deleted when the browser is closed.
Local storage:
Local storage is another way of HTML5 web storage. Once the current storage window is closed, the data will not be automatically deleted in local storage.

Q32) Why use the application cache and why in HTML5?

Answer: Application cache feedback is a web application cache. It’s  accessed without the need for an internet connection.
Some advantages of the use cache:

  • Offline Browsing – Use the app when Internet users are offline.
  • Speed – cache sources are loaded quickly
  • Reduce server load – download only updated sources from the web browser server.

Q33) Explain five new input types provided by HTML5 for shapes?

Answer: The following important, new data types are provided in HTML5:
Date: This allows the user to select a date.
Data Time-Local: This input type allows user time and time to select a date and time.
Date: This input type allows user time and time to select a time and time.
Month: It helps the user choose a month and year

Q34) What is Semantic Elements?

Answer: Semantic elements expresses its meaning for the web browser and developer.
Eg: Header , Footer

Q35) what is local storage ?

Answer: There is no expiration date for local storage and the data will be available in local storage even after we close the browser.

Q36) What is webstorage ?

Answer: Webstorage are used to store data in user’s web browser and it’s more secure than normal cookies.

Q37) What are the types of webstorage?

Local storage and session storage.

Q38) What is session storage?

Answer: It is used to store the data for one session and no data will be available once you close the corresponding browser tab.

Q39) What is canvas?

Answer: It is used to create graphics on the webpage using JavaScript.

Q40) What is the use of SVG?

Answer: It is XML based ,so that every element will be available in DOM .

Q41) Which method support event handlers to create graphics?

Answer: SVG

Q42) Name few newly added input type in HTML5?

Answer: Date, color ,url ,email,range, search,week,month and number

Q43) What is Non semantic Elements?

It doesn’t has meaning to express .
Eg: Span , Div.

Q44) A developer has been given an assignment to create a webpage for a shopping application. Which of the below language he need to learn to create the basic structure of the webpage?

Answer: markup.

Q45) A developer wants to create a HTML page. In which part of the code he can keep the information about the page?

Answer: head section.

Q46) While creating HTML page we use various HTML elements. All of them together creates HTML document. Which HTML element encloses all other HTML elements?

Answer: html.

Q47) HTML is case-sensitive?

Answer: False.

Q48) HTML is platform-independent?

Answer: True.

Q49) When we write code for an HTML page, <!DOCTYPE> is the very first thing we write. What information does <!DOCTYPE> declaration provides?

Answer: Version of HTML.

Q50) In HTML we have different types of elements. Few of them has only start-tag but no end-tag. What do you call elements which have both start-tag and end-tag?

Answer: Container.

Q51) In HTML webpage different types of element will render in different way.
Which of below type of element always starts in new line?

Answer: Block.

Q52) We use Metadata element in head section of the webpage to provide some key value so that our webpage gets listed in the search result. State true or false with respect to below statement about Metadata element. “Output of Metadata element is displayed on browser.”

Answer: False.

Q53) When we use Metadata element in our HTML code our intention is to help some ——– , which uses output of Metadata element?

Answer: Computer programs

Q54) A developer has created a webpage but has not used any of the sectioning element in the code. His web page will not be considered as the best designed webpage as the sectioning elements add ___________to webpage’s content.

Answer: semantic

Q55) Sam wants to organize his HTML code with the help of sectioning elements.

Answer: article

Q56) Which sectioning element he should use for webpage’s main content?

Answer: section

Q57) A developer is using sectioning elements to organize his HTML code. Which sectioning element he should use for grouping thematic content in his webpage? Which sectioning element is used for content related to main content?

Answer: Aside

Q58) Grouping elements are used to group content.

Answer: true

Q59) Which of the following element is used to group citation?

Answer: blockquote

Q60) Output of Division element is visible to user.

Answer: false

Q61) Is it possible to nest HTML lists?

Answer: Yes

Q62) Webpage can be linked to itself by creating _____________.

Answer: Bookmark

Q63) Text-level semantics element adds _____________ to webpage’s content.

Answer: Meaning & semantic

Q64) _____________ element acts as a container for all table elements.

Answer: table

Q65) _____________ element defines heading for table.

Answer: caption

Q66) _____________ attribute merges column.

Answer: colspan

Q67) _____________ attribute merges row.

Answer: Rowspan

Q68) Input elements are used to take user inputs.

Answer: true

Q69) Type of input element is specified using _____________ attribute.

Answer: Type

Q70) What are the new things that got added in HTML5 that was not part of HTML4?


  • Doctype declaration was made very easy in HTML5
  • Accessing the geographical location in HTML5
  • Adding of video , audio tags (Multimedia elements)

Q70) Can you explain the structure of HTML5?


<!DOCTYPE html>
My Page
<h1>this is a h1 tag</h1>

Q71) What are the different types of lists used in HTML?

Ordered list :

<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>

Unordered list :

<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>

Q72) How do you write a comment in HTML?

<!- - This is a comment -- >

Q73) How do you create a anchor tag in HTML?

<a href=”www.link.com”>Test link</a>

Here ‘href’ determines the link where the user wants to navigate on click of that link.

Q74) Create a HTML table that outputs like following : Name   Id Naveen 1, Madhu  2

Answer :


Q75) Create few elements in a webpage Textbox, Checkbox,Radio button, Textarea having 40 rows and 40 columns


  • <input type=”text”/>
  • <input type=”checkbox”/>
  • <input type=”radio”/>
  • <textarea rows=”40” cols=”40”></textarea>

Q76) Give an example of a tag which doesn’t have an end tag?

Answer : <br> – This is a break tag and it doesn’t have an end tag

Q77) What do you mean by semantic elements and give few examples ?

Answer : Semantic elements are those where the name of the element determines which type of element it is.

Examples : header , footer, navbar tags

Q78) What are the different types of storage in HTML?

Answer :

  • Local storage
  • Session storage
  • Cookies

Q79) How will you link your external javascript file in your html page?

Answer : <script src=”www.file.js”></script>

Q80) What is the purpose of using iframes in html?

Answer : iframes are used to create nested webpage in html

Q81) What is canvas element ?

Answer : Canvas element is used to create graphics on a webpage.

Example : <canvas width=”200” height=”200”></canvas>

Q82) What is SVG element?

SVG is used to describe two dimensional vector graphics.

Example :

<svg width=”200” height=”200”>

<circle cx=”50” cy=”50” r=”40” stroke=”red” fill=”yellow”/>


Q83) How do you define a button in HTML?

Answer : <button type=”button”>Click me</button>