HTML Interview Questions and Answers For Experienced and Freshers
HTML Interview Questions and Answers For Experienced and Freshers
HTML interview questions and answers are entirely based on core concepts of HTML and
related topics.
What is HTML?
HTML is the short form of Hypertext Markup Language. HTML is used to design and
display pages on the web. It makes the text content more attractive and dynamic. We can
create tables, add images, videos, links in our text. We can also add animation to our page to
make it more attractive. Every HTML page starts with <html> tag and end with </html> tag.
It has two main parts head section and body section.
There are some HTML tags that don't have closing tag like <br>, <hr>, <input> and <image>
tag.
Some tags don't have a closing tag. HTML tags are main part of HTML. We can create
HTML documents and render their properties with HTML tags and properties may differ for
different tags.
Syntax
There are six different heading types defined with <h1> to <h6> tags. Each heading tag
displays the content with different size. <h1> tag is the largest heading tag and <h6> is the
smallest heading tag.
Example:
<h1>Title 1</h1>
<h2>Title 2</h2>
<h3>Title 3</h3>
<h4>Title 4</h4>
<h5>Title 5</h5>
<h6>Title 6</h6>
When we form HTML tag HTML elements are enclosed by brackets <> . HTML elements
are used to communicate with a browser and to render text. Most of HTML tags are in pairs,
and they cover the text.
It is coding style that we can use to reinforce the meaning of the content. For example In
semantic HTML we use <strong> </strong> tag for bold statement as well as <em> </em>
tag for italic statement insted of using <b> </b> and <i></i> tags.
We can link many different web pages using a single image in the Image map. We can also
define shapes in images that you want to take part in an image mapping. It is represented by
<map> tag.
We can use the iframe tag to represent a webpage within a webpage. It defines an inline
frame on the HTML page.
Syntax
Here in src, we write the URL of the page which we want to use as a subpage.
Example
<html>
<body>
<h2>HTML Iframe example</h2>
<p> We can use the height and width attributes to specify the size
of the iframe:</p>
<iframe src="https://www.errorsea.com/" height="300"
width="400"></iframe>
</body>
</html>
You can insert a copyright symbol by using © or © in an HTML file.
No, you can apply hyperlinks on text and images both. The HTML <a> tag defines a
hyperlink that links one page to another page. We must use the "href" attribute in <a> tag to
generate a hyperlink.
You can use indents to keep the list elements straight in the HTML file.
A style sheet is used to build transportable, a consistent and well-designed style template. We
can use these templates on several different web pages. It explains the formatting of a
document written in HTML language.
We can create a multicolor text on a web page by using <font color ="color"> </font> for the
specific texts.
The color of the bullet is the color of the first text of the list. So, whenever we want want to
change the color of the bullet, we must change the color of the text.
Marquee tag is used to put the scrolling text on a web page. We can scroll the image or text to
up, down, left or right automatically. We should put the text within the
<marquee></marquee> tag, which you want to scroll.
<br> tag - This tag is used to separate the line of text. It breaks the current line and
brings the flow to the next line.
<p> tag - This tag contains the text in the form of a paragraph
<blockquote> tag - This tag is used to define a large quoted section. Whenever we
want to display large quotation, then we should put the entire text within
<blockquote> </blockquote> tag.
We can use the following method to put the picture as a background image of a web page.
We should put this code after </head> tag.
Here, we can replace the "errorsea.gif" with the name of an image file which we want to
display on your web page as a background image.
Example
<span style="color:#0f0f0f;">
On this text we have used span tag.
</span>
The <canvas> tag is used as a container to draw graphics on the web page using a scripting
language like JS. We can perform rendering of 2D shapes and bitmap images using canvas
tag. There are numbers of methods in canvas to draw boxes, paths, circles, add texts and
images.
Example
HTML SVG tag is used to describe the 2D vector and vector graphics. We should define
SVG images and their behaviors in XML text files. As an XML file, we can also edit an SVG
image with the text editor. SVG tag is mostly used for vector diagrams like pie charts, 2D
graphs in an X, Y coordinate system.
Example
1. mp4
2. WebM
3. Ogg
1. mp3
2. WAV
3. Ogg
Example
<audio controls>
<source type="audio/mpeg" src="love-me-like-you-do.mp3">
</audio>
We can use the button tag to create a button within the HTML page or forms on the web
page. We can use the button as a "submit" or "reset" or "cancel" button.
We can use the figure tag to add a picture in a specific document on the web page. It is also
used to handle the group of diagrams, photos, and code listing with some embedded content.
Example
<p>Errorsea is the best platform for improving your coding skills and
gettin solution of your problems."</p>
<figure>
<img src="images/errorsea.jpg" alt="Error Sea"/>
</figure>
The HTML5 datalist tag facilitates users to choose the predefined options to the users to
select data.
Example
Conclusion
This is all about HTML interview questions with complete answers. I am sure it will help you
in cracking the web designer interview as an experienced or a fresher, and it will increase
your confidence, too.