Interview Questions and Answers: HTML

 HTML Interview Questions and Answers



Beginner HTML Interview Questions and Answers

Here are some beginner level HTML interview questions and answers:

1. What is HTML?

HTML is an abbreviation of Hypertext Markup Language. This is the universal language of the World Wide Web (WWW). With HTML, pages on the web can be created. In order to make a website, proper HTML coding and structuring is imperative as well as essential.

2. What are “Tags”?

An HTML tag comprises of three things. There is an opening tag, which is followed by the content and ending tag. Most of the tags need to be closed if you have opened them. However, there are some unclosed tags too. The syntax is: <tag>content</tag>

The web browser reads an HTML document from top to bottom and from left to right. Browser reads the tags and displays the page accordingly.

3. Do all HTML tags essentially possess ending tags?

Well, most of the HTML tags have end tags. However, there are a few exceptions. Text formatting HTML tags do not generally have an ending tag. For example, text bold and italic tags do not come with ending tags.

4. What are different tags for adding headlines to HTML documents?

In HTML, a total of six types of heading tags can be seen. The first and primary heading tag is known as the H1 tag. Like the H1 tag, there are heading tags till H6. The heading tag syntax looks like:

<h1>content</h1>


<h2>content</h2>


<h6>content</h6>

5. Which tag is used for creating a hyperlink with HTML?

In the HTML document, developers can hyperlink text as well as image. In order to create a hyperlink, <a href> tag is used and it is closed with </a> tag.

The syntax looks like:
<a href="http://www.websitedomain.com">Hyperlink Text</a>.

It is to be remembered that one can create three types of links with the help of HTML. These links are:

• Unvisited: The link comes in blue color and underlined hyperlink text.

• Visited: When a link is visited, the color becomes purple. Apart from that, everything remains the same.

• Active: An active link comes in red text color and as usual the hyperlink text is underlined.

6. Which HTML tag is used for displaying tables?

Data may be required to be displayed in tabular format and for that HTML comes with a set of tags. To create a table, you need to start with the <table> tag. Now, you need to define rows and cells in the table with <tr> and <td> tags. With the tag <caption>, you can add a caption to the table. Furthermore, there are many other tags related to text formatting in a tabular format.

Intermediate HTML Interview Questions

Here is a list of intermediate HTML interview questions and answers:

1. How is content added in a listed format in HTML?

In order to design a web page, different kinds of common lists are used. In the following section, those common lists are highlighted.

  • Ordered List

In the case of the ordered list, the list will be shown via serial wise numbers. In this case, <ol> tag is used.
  • Unordered List

For the unordered list, <ul> tag is used. In this case, the list appears in bulleted format.
  • Definition List

When <dl>, <dt> and <dd> tags are used for listing text, such a list is called definition list.

2. How can HTML tags and elements be differentiated?

In order to render texts, the HTML elements establish communication with the web browser. When the HTML elements are enclosed with brackets (<>), they turn into tags.

3. What is the definition of semantic HTML?

Semantic HTML can be defined as a coding style, which has been popularly adopted by professional website developers. In the case of semantic HTML, <b> tag is used for making the text bold instead of the tag <strong>. Similarly, <i> tag is used for making text italic instead of the <em> tag.

4. How has the image map been used?

Using a single image, many web pages can be linked through the image map feature of the HTML. For image mapping, developers should use <map> as the opening tag. Naturally, </map> will be the closing tag in this case.

5. How to create a basic webpage with HTML?

To create a web page, you need an HTML editor software or application. For example, Notepad of your computer can serve as the HTML editor. To start with, you need to add <HTML> tag. This tag should be closed right at the end of the page. In between HTML tags, you can add many tags as you like to add content in a structured format.

6. How to add a copyright symbol to your website page?

A copyright symbol can easily be added by typing &copy; in your HTML page. That special HTML entity will render "©". Instead of &copy;, many people also use &#169;.

7. Can you add a hyperlink to an image?

Yes, a hyperlink can be added to the image as well.

8. What do you understand by style sheet?

A style sheet has been defined as transportable and consistent style template. One template can be added to different websites. With the style sheet, the overall appearance and text formatting of the website can be controlled.

9. Is color attribute deprecated in HTML5?

To add multicolored texts on the webpage, you need to use the following HTML syntax:

<font color = “color”>Text</font>

In place of the word “color” inside the double inverted comma, you need to add the color code to add the desired color to your website text.

10. How can you add colors to the bullets?

The color of the bullet marks cannot be controlled, as they take the initial text color by default. If you change the color of the text later, the color of the bullet signs will also be changed.

Advanced HTML Interview Questions

Check out some advanced level HTML interview questions and answers:

1. What do you know about marquee?

In order to put scrolling text in a webpage, marquee has been used. It helps the image or text to come with “up and down” or “left and right” scrolling wheels. The marquee tag in HTML editor should appear as <marquee>.

2. How is background attribute deprecated in HTML?

To add a picture as the website background, you need to follow the HTML syntax as given below:

<body background = “image.gif”>

3. Why do you need span tags?

The span tag has been used for defining a group of content. It is also used for applying the styles to the inline elements. Span tag is quite similar to the Div tag in HTML. While span tag is related to inline elements, div tag is associated with block level content.


All the best for your interviews!

Post a Comment

0 Comments