HTML Questions Final

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

HTML Questions

1. What is the difference between block-level and inline elements in HTML?

2. Explain the purpose and use of the data-* attribute in HTML5.

3. How can you include a video in an HTML document? Describe the different
attributes available for the <video> element.

4. What is the difference between the <script> tag placed in the <head> section
and the <body> section of an HTML document?

5. Explain the purpose of the defer and async attributes on the <script> tag.

6. What is the difference between <section> , <div> , and <article> tags in HTML5?

7. How do you create an accessible form in HTML?

8. Explain the use and benefits of semantic HTML.

9. What is the purpose of the <meta> tag in HTML?

10. How do you create a responsive image using the <picture> element in HTML5?

11. What are web components and how do you create them in HTML?

12. Explain the purpose and usage of the srcset attribute in the <img> tag.

13. How can you create an HTML table with merged cells (both row-wise and
column-wise)?

14. Describe how to create an HTML5 <audio> element and explain its attributes.

15. What is the purpose of the <noscript> tag in HTML?

16. How do you handle browser compatibility issues with HTML5 elements?

17. Explain the difference between localStorage and sessionStorage in HTML5.

18. How can you embed an SVG directly into an HTML document?

19. What is ARIA and how do you use it in HTML to enhance accessibility?

20. How do you create a dropdown menu using HTML and CSS only?

21. Explain the concept and use of iframes in HTML.

HTML Questions 1
22. What is the contenteditable attribute and how do you use it?

23. Describe the difference between the <b> and <strong> tags in HTML.

24. How do you use the <canvas> element in HTML5, and what are its common use
cases?

25. What is the purpose of the hidden attribute in HTML5?

26. How do you create a favicon for your website using HTML?

27. Explain the use and differences between the <link> , <style> , and <@import> for
including stylesheets in an HTML document.

28. How do you create a modal dialog box in HTML and CSS?

29. What are custom data attributes and how can they be used in HTML?

30. How can you create a progress bar in HTML5?

31. Explain the difference between the <em> and <i> tags in HTML.

32. How do you create a multi-step form in HTML?

33. Describe how you can use the <details> and <summary> tags to create an
accordion.

34. What is the purpose of the translate attribute in HTML5?

35. How do you create a responsive navigation bar using HTML and CSS?

36. Explain the concept of shadow DOM in the context of web components.

37. How do you create an HTML document that supports multiple languages?

38. What is the manifest attribute in HTML5, and how is it used?

39. How do you create a collapsible/expandable content section using HTML and
CSS?

40. What is the difference between the alt and title attributes for images in
HTML?

41. How do you implement lazy loading of images in HTML?

42. Explain the purpose of the <template> tag in HTML.

43. How do you create an HTML document with a fixed header and footer?

HTML Questions 2
44. Describe the use of the autocomplete attribute in form elements.

45. How do you use the <output> tag in HTML5 forms?

46. What is the purpose of the <time> tag in HTML5?

47. How do you implement browser caching strategies using HTML5?

48. Explain the use of the sandbox attribute in iframes.

49. How do you create a sticky element using HTML and CSS?

50. Describe how to use microdata in HTML to improve SEO.

51. How do you create an image map in HTML and what are its use cases?

52. What is the difference between the rel and rev attributes in the <link> tag?

53. Explain the purpose of the inputmode attribute in HTML5.

54. How do you create a custom tooltip using HTML and CSS?

55. What are the different types of input fields available in HTML5 forms?

56. Explain the use of the pattern attribute in HTML5 forms.

57. How do you create a responsive grid layout using HTML and CSS?

58. What is the purpose of the <wbr> tag in HTML?

59. How do you handle form validation using HTML5 attributes?

60. Explain the use of the novalidate attribute in the <form> tag.

61. How do you create a fullscreen background image using HTML and CSS?

62. What is the difference between the <mark> and <cite> tags in HTML?

63. How do you create an HTML email template that is compatible with most email
clients?

64. Explain the use of the accept attribute in the <input> tag for file uploads.

65. How do you create a fixed sidebar using HTML and CSS?

66. What is the purpose of the <legend> tag in HTML forms?

67. How do you create a print-friendly version of a webpage using HTML and
CSS?

HTML Questions 3
68. Explain the difference between the <abbr> and <acronym> tags in HTML.

69. How do you create an HTML5 form with placeholder text and floating labels?

70. What is the draggable attribute and how do you use it in HTML5?

71. How do you implement a countdown timer using HTML and JavaScript?

72. Explain the purpose of the <base> tag in HTML.

73. How do you create an HTML5 form with multiple file uploads?

74. What is the http-equiv attribute in the <meta> tag used for?

75. How do you create a responsive carousel using HTML and CSS?

76. Explain the use of the <output> tag in HTML5 forms.

77. How do you create a parallax scrolling effect using HTML and CSS?

78. What is the difference between the <optgroup> and <option> tags in HTML
forms?

79. How do you implement form fieldsets and legends to group related fields in
HTML forms?

80. What is the purpose of the is attribute in custom elements in HTML5?

81. How do you create a sticky footer that always stays at the bottom of the page
using HTML and CSS?

82. Explain the use of the spellcheck attribute in HTML5.

83. How do you implement an infinite scrolling feature using HTML and
JavaScript?

84. What is the difference between the <datalist> and <select> tags in HTML
forms?

85. How do you create a toggle switch using HTML and CSS?

86. Explain the purpose of the nonce attribute in the <script> tag.

87. How do you create a breadcrumb navigation using HTML and CSS?

88. What is the itemprop attribute and how is it used in HTML5 microdata?

89. How do you create a timeline using HTML and CSS?

HTML Questions 4
90. Explain the difference between target="_blank" and rel="noopener noreferrer" in
anchor tags.

91. How do you create a progress indicator that shows the current step in a multi-
step form using HTML and CSS?

92. Explain the use of the tabindex attribute in HTML and how it affects keyboard
navigation.

93. How do you implement a lightbox effect for images using HTML and CSS?

94. What is the purpose of the <keygen> tag in HTML5, and why is it deprecated?

95. How do you create a fixed table header and scrollable body using HTML and
CSS?

96. Explain the difference between aria-labelledby and aria-describedby attributes in


HTML for accessibility.

97. How do you create a collapsible sidebar navigation menu using HTML and
CSS?

98. What is the loading attribute in the <img> tag, and how do you use it for lazy
loading images?

99. How do you implement a custom file upload button using HTML and CSS?

00. Explain the use and differences between preload and prefetch in the <link>

tag.

HTML Questions 5

You might also like