HTML Interview Questions
1) What is HTML?
HTML stands for Hyper Text Markup Language. It is used for creating web pages and web applications. HTML documents are made up of two things: the content and the tags.
2) What are the features of HTML5?
The features of HTML are:
3) Who is the father of HTML?
Tim Berners-Lee is known as the father of HTML.
4) Do all HTML tags come in pair?
NO, for example: <img> tag and <br> tag.
5) What is difference between HTML and XHTML?
The differences between HTML and XHTML are:
6) How to create a button which acts like a link?
There are two ways to create button which acts like a hyperlink are:
7) What are the new attributes provided in HTML5 for <form>?
The attributes provided in HTML5 are:
8) What are the new attributes provided in HTML5 for <input>?
Following are the new attributes provided in HTML5 for <input>:
9) How do you insert a comment in html?
Comment Syntax in HTML5 is :<!-- TYPE COMMENT HERE --! >
10) Write a HTML table tag sequence that output the following:
101 rupees 100 bugs 500 dollar
11) Which browsers support HTML 5?
Almost all browsers support HTML5:
12) What is datalist in HTML 5?
Datalist elements provide you the autocomplete feature.
Below is the Html code for datalist:
13) What are the New Media Elements in HTML5?
New Media Elements are:
14) What are the new APIs provided by the HTML 5 Standard?
The HTML 5 standard comes with a number of new APIs.
A few of them are as follows:
15) What are the extension supported by HTML?
HTML supports both .htm and .html extension.
16) Name three ways to define a color in html?
There are three ways to define a color in html:
17) HTML5 <input> Types ?
Following are the input types in HTML5:
18) How to add audio and video in HTML5?
AUDIO AND VIDEO controls with autoplay feature:
19) What does a <hgroup> tag do?
The <hgroup> tag is used to group heading elements.
The <hgroup> element is used to group a set of <h1> to <h6> elements.
20) What are the common lists available in HTML?
The common lists available in HTML are:
21) What is Image Map?
Image Map: By using a single image, you can link too many different Web pages.
22) How will you align a table to the Right, Left and Center?
To align a table to the Right: use <table align="right">
To align a table to the Left: use <table align="left">
To align a table to the Center: use <table align="center">
23) How can I hide my page source?
No, you cannot hide page source because it is required by browser to display the content.
24) Can you create a multi colored text on a web page?
Yes, you can create a multi colored text on a web page.
25) What are empty elements?
The HTML elements with no content are known as empty elements.
For example: <br> tag and <hr> tag etc
26) What is span tag?
span tag is used to:
27) Which tag is used to separate section of texts in HTML?
Usually <br> tag is used.
Some other tags:
These tags are also used to separate section of texts.
28) How to add an image as background image of a web page?
29) What are the ways to include the CSS with HTML?
The ways to include the CSS with HTML are:
30) What is <dl> tag?
<dl> tag defines the description list.
The <dl> tag is used with <dt> and <dd> tags.
Here <dt> tag defines the data term and <dd> tag defines the data definition.
31) What is Cell Padding?
Cell Padding: It is the space or gap between the cell content and cell border.
32) What is Cell Spacing?
Cell Spacing: It is the gap or space between two cells of same tables.
35) What is Marquee in HTML?
Marquee is a tag in HTML that is used to scroll an image or text in the web page either horizontally or vertically.
36) What are the attributes of marquee available in HTML?
The attributes of marquee are:
37) What is canvas in HTML?
Canvas is a tag in HTML that is used to draw graphics on web page. The canvas element allows us to build 2D shapes and bitmap images. Here, you must need a scripting language to use canvas in HTML.
38) How to create a basic empty HTML canvas?
Example of basic empty canvas:
39) How to create a progress bar in HTML?
Example of progress bar with value and max attributes:
40) What are the types of Frames tags used in HTML?
The types of Frames tags used in HTML are:
41) How would you automatically transfer your visitors to a new web page?
You can automatically transfer your visitors to a new page by using meta tag.
42) Can a single hyperlink points to two different web pages?
43) What are the types of video formats supported by HTML5?
There are three types of video formats supported by HTML5 are:
44) How to use copyright symbol on a browser page?
There are two ways to use the copyright symbol on a browser are:
45) What is SVG?
SVG stands for Scalable Vector Graphics. This modularized language is used to describe graphics in XML.
SVG (Scalable Vector Graphics) is mostly used for vector diagrams like:
46) How to draw a circle using SVG tag in HTML?
47) What is figure tag in HTML?
<figure> tag is used to add an image on the web page with caption.
<figure> tag is the new tag introduced in HTML5.
48) Are HTML tags case sensitive?
NO, HTML tags are not case sensitive.
49) What is the use of getCurrentPosition() method of geolocation object in HTML5?
getCurrentPosition() method: This method is used to retrieves the current geographic location of the user.
50) What is use of watchPosition() method of geolocation object in HTML5?
watchPosition() method: It is used to retrieves periodic updates about the current geographic location of the device.