11
Which of the following is the correct way to define a table heading in HTML5?
A.
B.
C.
D.
Answer & Solution
The <thead> tag defines a header section for a table, which contains one or more <tr> rows with <th> cells for the header.
12
How can you include a video file in an HTML5 document?
A.
B.
C.
D.
Answer & Solution
The <video> tag is used to embed video files, and the controls attribute adds play, pause, and volume control to the video player.
13
How do you define a self-closing tag in HTML5?
A.
B.
C.
D.
Answer & Solution
In HTML5, void elements like <input>, <img>, and <br> do not require a closing tag, though they may sometimes be written with a self-closing slash (<input />) in XHTML.
14
What attribute is used to specify the URL for an iframe in HTML5?
A.
B.
C.
D.
Answer & Solution
The src attribute in the <iframe> tag specifies the URL of the webpage to be embedded in the iframe.
15
What is the purpose of the <canvas> tag in HTML5?
A.
B.
C.
D.
Answer & Solution
The <canvas> tag allows for dynamic rendering of graphics and images through JavaScript, enabling complex shapes, animations, and game graphics.
16
How can you create a responsive image in HTML5 that adjusts according to the screen size?
A.
B.
C.
D.
Answer & Solution
Setting the width to 100% and height to auto ensures the image scales proportionally according to the viewport's width.
17
Which HTML5 element is used for defining a footer section of a webpage?
A.
B.
C.
D.
Answer & Solution
The <footer> tag is used to define a footer for the document or a section, typically containing metadata, copyright information, or links.
18
Which tag is used in HTML5 to define a section for navigation links?
A.
B.
C.
D.
Answer & Solution
The <nav> tag is used to define a section of a page that links to other pages or parts of the same page.
19
Which of the following is the correct HTML5 structure for defining a form that posts data to a server?
A.
B.
C.
D.
Answer & Solution
The enctype="multipart/form-data" is used when the form includes file uploads. For regular text-based form submissions, method="post" or method="get" is used.
20
Which attribute is used to specify a form input element’s initial value?
A.
B.
C.
D.
Answer & Solution
The value attribute is used to set the initial value of an input element in a form.
