HTML Interview Questions

HTML interview questions

These HTML questions have been designed for various interviews, competitive exams and entrance tests. We have covered questions on both basic and advanced concepts which will help you improve your skills to face interview questions on HTML.

Who are these HTML interview questions designed for?

All the Front End developers, UI/ UX developers and designers will find these questions extremely useful. All freshers, BCA, BE, BTech, MCA and college students wanting to make a career in front end designing will be highly benefitted by these questions.

HTML interview questions topics

This section covers HTML5 topics like - HTML Basic, Elements, Attributes, Headings, Paragraphs, Styles, Formatting, Quotations, Comments, CSS, Links, Images, Tables, Responsive, Symbols, XHTML, Forms, Form Elements, Input Types, Input Attributes etc.

Video : HTML Interview Questions and Answers

1. What do you know about HTML?

Answer:

HTML (HyperText Markup Language) is a standard text formatting language of the World Wide Web (WWW) used for creating and displaying pages on the web.

Hypertext is text that links to other information.

Markup language is a programming language that is used for creating attractive, interactive and dynamic web page

HTML has various tags and each tag contains different content. These tags are composed of three things:

1. Opening Tag
2. Content
3. Closing Tag

Content is placed between tags to display data on the web page.

HTML TagsDescription
<!DOCTYPE>It defines the document type.
<html>It defines an HTML document.
<head>It defines information about the document.
<title>It defines a title for the document.
<body>It defines the document's body.
<h1> to <h6>It defines HTML headings.
<p>It defines a paragraph.
<br>It inserts a single line break.
<hr>It stands for Horizontal Rule. It is used to put a line across the web page.

Example:

<!DOCTYPE>
<html>  
    <body>  
        <h2> This is Heading Tag </h2>
        <b> This is Bold Tag </b><br>
        <i> This is an Italic Tag </i><br>
        <u> This is an Underline Tag</u>
    </body>  
</html>


html tags

2. Is it mandatory to close all the tags in HTML?

Answer:

No, it is not mandatory to close all the tags in HTML.

Some HTML tags are unclosed that don't need a closing tag. For example, <img>, <br>, <hr>

3. What is meant by head in HTML?

Answer:

In HTML, head contains meta-information about the document.

The <HEAD> tag appears first in a document above the <BODY> tag.

This tag is a container for all the head elements.

Following are the tags which include inside the <HEAD> tag,

  • <title>
  • <style>
  • <base>
  • <script>
  • <link>
  • <meta>
  • <noscript>

4. What is the use of image map?

Answer:

A image map is an image with clickable areas.

This tag is used to define a client-side image map.

It is a list of coordinates relating to a specific image. It provides an easy way of linking various parts of an image without dividing the image into separate image files.

5. Does a hyperlink only apply to text?

Answer:

No, you can use hyperlinks on text and images both.

The HTML anchor tag <a href>...</a> defines a hyperlink that links one page to another page.

The "href" attribute is the important attribute of the HTML tag because this attribute indicates the link's destination. This attribute defines address of the file to be linked.

Syntax: Simple Link
<a href = "..........."> Link Text </a>

Example: Simple Link
<a href="abc.html">Click on the page</a>

Example: Image Link
<a href="default.asp">
  <img src="abc.jpg">
</a>

6. Is it possible to create multi-colored text on a web page?

Answer:

Yes, it is possible to create multi-colored text on a web page.

You can use <font color="color"> <\font> for the specific texts you want to color.

Example:

<!DOCTYPE html>
<html>
    <body>
        <p><font color="red">TutorialRide</font></p>
        <p><font color="blue">TutorialRide</font></p>
        <p><font color="green">TutorialRide</font></p>
    </body>
</html>


font color