Top 100 HTML Technical Interview Question And Answers

  • Last updated: December 14, 2025 By Sunil Shaw

Top 100 HTML Technical Interview Question And Answers

In this article you will see Top 100 HTML Technical Interview Question And Answers, from basic to intermediate and advance level. We are here to help you out for your interview.

1. What is HTML?

HTML stands for HyperText Markup Language. It is the standard language for creating web pages and web applications.

2. What are HTML tags?

The declaration DOCTYPE tells the web browser about the HTML version of the page.

3. What is the difference between HTML and XHTML?

HTML is more lenient and allows errors in the code, whereas XHTML is stricter and follows XML rules.

4. What are attributes in HTML?

Attributes provide additional information about HTML elements. They are always specified in the start tag and usually come in name/value pairs like name=”value”.

5. What is the purpose of the <head> tag?

The tag contains meta-information about the HTML document, such as its title, links to stylesheets, and metadata.

6. What does the <title> tag do?

The tag defines the title of the HTML document, which appears in the browser’s title bar or tab.</p>

7. What is the <body> tag?

The tag defines the main content of the HTML document that is visible to the user.

8. What are semantic HTML tags?

Semantic HTML tags provide meaning to the web page rather than just presentation. Examples include
, , , and .

9. What is the <div> tag used for?

The tag groups and styles elements together as a block-level element.

10. What is the <span> tag used for?

Use the tag to group and style text or other inline elements as an inline element.

11. What is the difference between block-level and inline elements?

Block-level elements start on a new line and take up the full width available, while inline elements do not start on a new line and only take up as much width as necessary.

12. How do you create a hyperlink in HTML?

You can create a hyperlink using the <a> tag with the href attribute. Example: <a> href="https://www.example.com">Link</a>.

13. How do you add an image to a web page?

You can add an image using the <img> tag with the src attribute specifying the path to the image. Example: <img src="image.jpg" alt="Description">.

14. What is the <alt> attribute used for in the <img> tag?

During some complecation or during loading if image not loaded, alt attribute provides alternative text for an image to display.

15. What is the purpose of the <meta> tag?

The <meta> tag provides metadata about the HTML document, such as character set, viewport settings, and author information.

16. How do you create a list in HTML?

You can create an unordered list with the <ul> tags and list items with the <li> tag, or an ordered list with the <ol> tags and list items with the <li> tag.

17. What is the difference between <ul> and <ol> tags?

<ul> creates an unordered list with bullet points, while <ol> creates an ordered list with numbers.

18. What are the different types of input elements in HTML forms?

Common input elements include <input type="text">, <input type="password">, <input type="radio">, <input type="checkbox">, <input type="submit">, and <input type="button">.

19. How do you create a form in HTML?

You create a form using the <form> tag, which can contain various input elements and a submit button.

20. What is the <label> tag used for?

The <label> tag is used to define labels for input elements, improving accessibility and user experience.

21. How do you create a table in HTML?

You create a table using the <table> tag, with <tr> for rows, <th> for headers, and <td> for data cells.

22. What are the global attributes in HTML?

In HTML global attributes are id, class, style, title and data. Global attributes can be use in every HTML elements e.g :- <span id="header" ></span>, <span class="header" ></span>. We can directly target global attributes by using JavaScript to manipulate HTML element.

23. What is the purpose of the id attribute?

The id attribute uniquely identifies an HTML element within the document.

24. What is the purpose of the class attribute?

The class attribute defines a class name for an element, which you can use to style HTML elements with CSS.

25. How do you comment out code in HTML?

You can comment out code in HTML using <!-- Comment -->.

26. What is the <iframe> tag used for?

The <iframe> tag is used to embed another HTML document within the current document.

27. What is the <link> tag used for?

Use the <link> tag to link external resources, such as stylesheets, to the HTML document.

28. What is the <script> tag used for?

The <script> tag is used to embed or reference JavaScript code within an HTML document.

29. What is the <style> tag used for?

The <style> tag is used to embed CSS styles within the HTML document.

30. What is the <nav> tag used for?

Using the <nav> tag defines a block of navigation links.

31. What is the <header> tag used for?

Using the <header> tag defines the header section of a document or section.

32. What is the <footer> tag used for?

Using the <footer> tag defines the footer section of a document or section.

33. What is the <section> tag used for?

Using the <section> tag, you define a section of a document, typically with a heading.

34. What is the <article> tag used for?

An independent, self-contained piece of content is defined using the <article> tag.

35. What is the <aside> tag used for?

Web developers use the <aside> tag to define content that is tangentially related to the main content.

36. What is the <figure> tag used for?

People use the <figure> tag to group media content (images, diagrams, etc.) and their captions.

37. What is the <figcaption> tag used for?

The <figcaption> tag defines a caption for a <figure> element.

38. What is the <time> tag used for?

The <time> tag is used to define a date and/or time.

39. What is the <mark> tag used for?

The <mark> tag is used to highlight text for reference or importance.

40. What is the <progress> tag used for?

Web developers use the <progress> tag to represent the progress of a task.

41. What is the <meter> tag used for?

The <meter> tag is used to represent a scalar measurement within a known range.

42. What is the <details> tag used for?

The <details> tag is used to create a disclosure widget that users can open and close.

43. What is the <summary> tag used for?

The <summary> tag is used to define a summary for the content of a <details> element.

44. What is the <dialog> tag used for?

The <dialog> tag is used to define a dialog box or interactive component.

45. What is the <template> tag used for?

The <template> tag is used to declare fragments of HTML that can be cloned and inserted in the document later using JavaScript.

46. What is the <canvas> tag used for?

Developers use the <canvas> tag to draw graphics on the fly via scripting (usually JavaScript).

47. What is the <svg> tag used for?

The <svg> tag is used to define vector-based graphics.

48. What is the <audio> tag used for?

The <audio> tag is used to embed sound content in an HTML document.

49. What is the <video> tag used for?

Web developers use the <video> tag to embed video content in an HTML document.

50. What is the <source> tag used for?

The <source> tag specifies multiple media resources for <audio> and <video> elements.

51. What is the <track> tag used for?

The <track> tag is used to specify text tracks for <audio> and <video> elements.

52. What is the <map> tag used for?

The <map> tag is used to define an image map with clickable areas.

53. What is the <area> tag used for?

The <area> tag defines an area inside an image map.

54. What is the <object> tag used for?

The <object> tag is used to embed multimedia elements such as images, audio, video, or web applications.

55. What is the <embed> tag used for?

The <embed> tag is used to embed external content like multimedia or interactive content.

56. What is the <base> tag used for?

The <base> tag specifies the base URL for all relative URLs in a document.

57. What is the <b> tag used for?

The <b> tag is used to make text bold without implying any extra importance.

58. What is the <strong> tag used for?

The <strong> tag is used to indicate that the text is of strong importance, typically displayed in bold.

59. What is the <i> tag used for?

The <i> tag is used to display text in italics for an offset text or a technical term.

60. What is the <em> tag used for?

The <em> tag is used to emphasize text, typically displayed in italics.

61. What is the <u> tag used for?

The <u> tag is used to underline text.

62. What is the <s> tag used for?

The <s> tag is used to indicate text that is no longer correct or relevant (strikethrough).

63. What is the <del> tag used for?

The <del> tag is used to represent deleted text.

64. What is the <ins> tag used for?

The <ins> tag is used to represent inserted text.

65. What is the <sub> tag used for?

The <sub> tag is used to display text as subscript.

66. What is the <sup> tag used for?

The <sup> tag is used to display text as superscript.

67. What is the <code> tag used for?

The <code> tag is used to display a fragment of computer code.

68. What is the <pre> tag used for?

Web developers use the <pre> tag to display preformatted text, preserving whitespace and line breaks.

69. What is the <samp> tag used for?

The <samp> tag is used to represent sample output from a computer program.

70. What is the <var> tag used for?

The <var> tag is used to represent a variable in programming or a mathematical expression.

71. What is the <cite> tag used for?

The <cite> tag is used to represent the title of a work.

72. What is the <abbr> tag used for?

The <abbr> tag is used to represent an abbreviation or acronym.

73. What is the <address> tag used for?

The author or owner of the document uses the <address> tag to provide contact information.

74. What is the <q> tag used for?

The <q> tag is used to define a short inline quotation.

75. What is the <bdo> tag used for?

The <bdo> tag is used to override the current text direction.

76. What is the <ruby> tag used for?

The <ruby> tag is used to display ruby annotations, which are small texts above or beside the main text, often used in East Asian typography.

77. What is the <rt> tag used for?

The <rt> tag is used to define the pronunciation of characters (used inside <ruby>).

78. What is the <rp> tag used for?

The <rp> tag is used to provide fallback parenthesis for browsers that do not support ruby annotations.

79. What is the <wbr> tag used for?

The <wbr> tag defines a possible line-break point within a text.

80. What is the <noscript> tag used for?

The <noscript> tag defines alternative content for users who have disabled scripts in their browser or have a browser that doesn’t support scripting.

81. What is the <br> tag used for?

We use <br> tag to insert a line break in text.

82. What is the <hr> tag used for?

We use <hr> tag to insert a thematic break or horizontal rule in a page.

83. What is the <small> tag used for?

Surely the <small> tag is used to create smaller text, typically for side comments or fine print.

84. What is the <dfn> tag used for?

The <dfn> tag is used to indicate the defining instance of a term.

85. What is the <legend> tag used for?

The <legend> tag is used to provide a caption for a <fieldset> element.

86. What is the <fieldset> tag used for?

Developers use <fieldset> tag to group related elements in a form.

87. What is the <optgroup> tag used for?

The <optgroup> tag is used to group related options within a <select> element.

88. What is the <option> tag used for?

Undoubtedly the <option> tag is used to define options within a <select> element.

89. What is the <select> tag used for?

The <select> tag is used to create a drop-down list.

90. What is the <textarea> tag used for?

Undoubtedly the <textarea> tag is used to create a multi-line text input field.

91. What is the <button> tag used for?

The <button> tag is used to create a clickable button.

92. How do we use the data-* attribute?

Web developers use the data-* attribute to store custom data private to the page or application.

93. What is ARIA in HTML?

Undoubtedly ARIA (Accessible Rich Internet Applications) is a set of attributes that define ways to make web content and applications more accessible to people with disabilities.

94. What is the difference between localStorage and sessionStorage?

localStorage stores data with no expiration time, whereas sessionStorage stores data for the duration of the page session.

95. What is the defer attribute in the <script> tag?

The defer attribute instructs the browser to execute the script after parsing the document.

96. What is the async attribute in the <script> tag?

The async attribute tells the browser to execute the script asynchronously as soon as it is available, without waiting for the document to finish parsing.

97. What is the <main> tag used for?

Developers use the <main> tag to define the main content of the document, which is unique and central to the page.

98. What is the <kbd> tag used for?

The <kbd> tag is used to represent user input.

99. What is the <blockquote> tag used for?

Using the <blockquote> tag, you can define a block of text that quotes another source.

These questions and answers should help you prepare for an HTML interview and cover a wide range of topics related to HTML.

What are the basic concepts of machine learning and algorithms


Follow on:
  • Twitter
  • Facebook
  • Instagram
  • Linkedin
  • Linkedin
Categorized as:
HTML
Sunil Shaw

Sunil Shaw

  • Youtube
  • Instagram
  • Twitter
  • Facebook
About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.




Leave a Comment

Your email address will not be public. Required fields are marked *

Popular Language Tutorials

If You want to build your own site Contact Us