TechieClues TechieClues
Updated date Jan 23, 2024
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.

36. What is HTML and what is its role in web development?

HTML stands for Hypertext Markup Language. It is a markup language that is used to create web pages and applications. HTML is the backbone of web development, as it provides the structure and content of a website or application.

37. What are the different versions of HTML?

The different versions of HTML are:

  1. HTML 4
  2. XHTML
  3. HTML5

38. What is the difference between HTML and HTML5?

HTML5 is the latest version of HTML and includes new features and improvements over previous versions.

Some of the key differences between HTML and HTML5 include:

  • HTML5 includes support for multimedia elements like video and audio.
  • HTML5 has new semantic tags like <header>, <footer>, and <article>.
  • HTML5 includes support for offline applications.

39. What are the different types of HTML elements?

There are two types of HTML elements: block-level elements and inline elements. Block-level elements start on a new line and take up the full width of their container, while inline elements don't start on a new line and only take up as much space as they need.

40. What is the difference between HTML elements and tags?

An HTML element is the individual component that makes up a web page, such as <div>, <p>, or <img>. An HTML tag is the code that is used to create an HTML element, such as <div></div>, <p></p>, or <img>.

41. What is the difference between a div and a span?

A <div> is a block-level element that is used to group together other HTML elements, while a <span> is an inline element that is used to apply styles to smaller pieces of text.

42. What is the difference between HTML and XHTML?

XHTML is a stricter version of HTML that follows stricter syntax rules and XML formatting. XHTML requires all elements to be closed and all attributes to be quoted, whereas HTML does not.

43. What is the purpose of the alt attribute in an img tag?

The alt attribute is used to provide alternative text for an image in case the image cannot be displayed. It is also used by screen readers for accessibility purposes.

44. What is the difference between the GET and POST methods in HTML forms?

The GET method is used to submit form data in the URL, while the POST method is used to submit form data in the HTTP request body. GET is used for submitting data that can be cached, while POST is used for submitting data that should not be cached.

45. What is the purpose of the target attribute in an anchor tag?

The target attribute is used to specify where to open the link when it is clicked. It can be set to "_blank" to open the link in a new window or tab, or set to "_self" to open the link in the same window or tab.

46. What is the difference between the <script> tag and the <link> tag?

The <script> tag is used to include JavaScript code in an HTML document, while the <link> tag is used to include external resources like CSS files.

47. What is the purpose of the href attribute in an anchor tag?

The href attribute is used to specify the URL that the link should point to when it is clicked.

48. What is the difference between the id and class attributes in HTML?

The id attribute is used to give a unique identifier to an HTML element, while the class attribute is used to group together multiple HTML elements with a common style.

49. What is the purpose of the meta tag in HTML?

The meta tag is used to provide metadata about an HTML document, such as the character encoding, keywords, description, and author information. This information can be used by search engines and browsers to display relevant information about the webpage.

50. What is the difference between the <head> and <body> tags in HTML?

The <head> tag is used to include metadata and other non-visible elements in an HTML document, such as the page title, meta tags, and links to external resources. The <body> tag is used to include the visible content of the webpage, such as text, images, and other HTML elements.



I specialize in creating and sharing insightful content encompassing various programming languages and technologies. My expertise extends to Python, PHP, Java, ... For more detailed information, please check out the user profile

Comments (0)

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