Sabari M Sabari M
Updated date Nov 24, 2021
Frequently asked popular HTML Interview Questions and Answers for freshers and experienced web developers. There is a chance to ask these listed questions in your next interview, so you can easily clear the interview at the first attempt.

1. What do you mean by HTML?

The full form of HTML is HyperText Markup Language. It is a type of language of WWW (World Wide Web). This standard text formatting language helps to make and display web pages. It helps to create an interactive and dynamic web site. Different images, text formats, links are involved here. We can save files by using the .html extension.

2. What are HTML tags?

HTML tags are considered as the main aspect of an HTML document that is used for specifying the particular HTML document. As an instance – the head tag is used to consist of all the head elements in the current HTML file.

3. Mention some common lists that are needed for designing a page.

We can easily insert a single or combination of the following lists –

  • Directory list
  • Definition list
  • Menu list
  • Ordered list
  • Unordered list

4. What do you mean by attributes and what are the basic uses?

All tags are having some specific attributes that change the behavior of tags. As an instance - the <input> tag is used as an attribute that is worked as a specifier for text filed, checkbox, radio button, or any other options.

Under each tag, these attributes are specified. Inside two angled brackets, each attribute is specified.

5. What do you mean by image map?

Image mas are used to link many web pages using only one single image. We can easily define shapes in images that is involved in image mapping.

6. Explain the basic differences between a block-level element and an inline element.

A block-level element An inline element
A block-level element is considered as a block that is involved to fill width. Inline elements are needed when these are defined. 
Examples - <div>, <form>, <img>, <section> Examples - <span>, <a>, <b>, <input>,  <strong>

7. How hyperlinks can be added to the text?  

Hyperlinks are added with both images and texts. It helps to link one page with another page. In HTML designing, the ‘href’ attribute plays a vital role in making hyperlinks.

Example: <a href = "..........."> Link Text </a>

8. What do you mean by a marquee?

This tag is used to scroll the text on a web page. So, Marquee can scroll images, text up, down, left, and right. We need to put the text that we need to scroll inside the <marquee>……</marquee> tag.

9. In image mapping, what is the role of alternative text?

During the usage of image maps, we face difficulties to find out the specific hotspots acceding to the links. With the presence of alternative text, we can add descriptive text for each hotspot link.

10. What do you mean by entities in HTML?

The entities in HTML are used as a replacement of reserved characters. So, we can also replace the characters that are not present on our keyboard with the help of entities. As some characters are reserved in HTML, these characters can easily replace by HTML entities.

11. Explain style sheets.

Style sheets help to make consistent, well-defined, and transportable style templates. So, these frameworks are connected with different web pages. This enables the HTML to easily maintain and change the look of all web pages of the present website.

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

Yes, it is possible to create multi-colored text on a web page. In order to make a multi-color text, we need to use <font color =” color”> </font> for particular texts that we want to color.

13. Explain the usage of span tags.

We need to use span tags for the following reasons:

  • For adding background on text,
  • To add color to text,
  • To highlight any color text.

14. When we need to use frames?

Frames are used for navigating. If a frame has the main links to the site that may appear at the top of the browser, we can see the content of these links in the remainder of the browser window.

15. What are the uses of the ‘br’ tag?

<br> syntax is used to separate each line of text. Just like this tag, HTML has two more similar types of tags such as <p> and <blockquote> used for separation of text.

16. Why do we need to group different checkboxes?

We can organize these all checkboxes at a time by grouping them. Checkbox buttons only have their names instead of belonging to the same group. So, a single web page may have different groups of checkboxes.

17. What do you mean by border and rule attribute?

By default, the cell borders are considered as 1-pixel thickness. This border is automatically present between cells with the presence of a condition. The condition is – attribute needs to be set to a nonzero number. Also, if a border attribute is not included, a 1-pixel default border again comes, and the rules attribute is added to the <table> tag.

18. What tags are used to change the color of bullets?

The bullet color is depending on the first character that is already listed. Suppose, I am surrounding <li> and the first character with defining a set of <font> tags having a particular attribute set, then bullet color. So, the first character will have a different color compared to the text.

19. What do you mean by HTML SVG?

SVG in HTML is used to define the two-dimensional vector or raster graphics. SVG images and their principles are used to define XML text. So, in these XML files, we can create and modify the SVG image with the presence of the text editor. In order to design vector type diagrams such as a 2-dimensional bar graph, pie chart we need SVG.

20. Explain semantic HTML.

Semantic HTML is considered as a coding style. It is basically a markup language that can reinforce the semantics of the given content. As an instance - <strong></strong> is used instead of <b> </b> tag for a bold statement.

21. Can you link a single text with two different web pages?

No, I can’t. Because <a> tag can take only one href attribute. Hence, it can only point to one web page.

22. Make some differences between DIV and SPAN.

Span elements are considered as in-line and generally used for small code of HTML inside a line. As an example – inside a paragraph, we can use span. Div is also known as the division element. It is used in block-line that can be equivalent to have a line-break and then it is used in a group of large HTML code.

23. Can you assign a specific color for table borders?

We need to use style sheets to assign a specific color in table borders. But the color of the table border is not the same as the color of the text in HTML.

24. URL is encoded in HTML – why?

In order to convert non-ASCII characters into a format that will be used on the internet, a URL is encoded. In case of URL has characters outside the ASCII set, the URL must be converted. Hence, the non-ASCII characters must be replaced by ‘%’ followed by hexadecimal digits.

25. How do you can send an email by the web page?

We need to use the following command:

<a href=”mailto:emailaddress”>text that needs to be clicked</a> 

This command helps to change the text into the clickable link to send the email.

26. What is the difference between active links and normal links?

As a default color, the blue color is set for both links. When a cursor is placed over the link, some browsers identify these links as the activate links. Other links that don’t have a mouse cursor on it considered normal links.  

27. Open the external CSS file in a browser – what will happen?

When I will try to open the CSS file, the browser will block this file as the file consists of a different extension. We need to reference this external CSS file by using the <link/> tag within another HTML document to use this CSS file.  

28. Name a few browsers that support HTML5?

The latest version of Mozilla Firefox, Google Chrome, Opera, etc. supports HTML5.

29. Explain the function of <figure> in HTML5.

<figure> tag is used to represent self-contained flow content. It is considered as a single unit works for referencing the main flow of the document.

30. What are the uses of HTML5 storage?

The basic advantages of HTLM5 are –

  • Up to 10 MB of data can be stored which is more compared to cookies have.
  • These web stored data can’t be transferred with the HTTP request.  

31. How do you create multi-color text in HTML?

In order to create multicolor text, we need to use <font color =”color”> </font>. It helps to color the specific text.

32. What are the web storage in HTML5?

There are two types of web storage present,

  1. Session storage
  2. Local storage.

33. What will happen if two sets of tags overlap?

If this situation occurred, only the first tag set will be identified. We can find this problem when text is not coming properly on a web screen.

34. How do you use align images and wrap text?

Tables are used to position images and text. We can also use style sheets to do so.

35. What is the command to insert copyright symbol?

We need to type and copy or we can use &#169.


Sabari M
Sabari M
Software Professional, India

IT professional with 15+ years of experience in Microsoft Technologies with a strong base in Microsoft .NET (C#.Net, ASP.Net MVC, ASP.NET WEB API, Webservices,...Read More

Comments (0)

There are no comments. Be the first to comment!!!