html interview questions and answers

HTML Interview Questions and Answers

by GangBoard Admin, February 28, 2019

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.

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?key=AIzaSyBu-916DdPKAjTmJNIgngS6HL_kDIKU0aU&callback=myMap"> </ 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.

No Comments

    Leave a Reply

    Your email address will not be published Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


    Online Training Quick Enquiry

    Get Free Online training

    Looking for Online Training