HTML Questions & Answers – HTML5 Semantics – 3

This set of HTML Assessment Questions and Answers focuses on “HTML5 Semantics – 3”.

1. Which element represents a dialog box?
a) <dialog>
b) <menuitem>
c) <menu>
d) <summary>
View Answer

Answer: a
Explanation: <dialog> element in HTML represents a dialog box or other interactive component like window or an inspector. This element includes global attributes. The tableindex attribute must not be used on <dialog> element. <menuitem> represents a command which helps user to pop up through menu. <menu> is a group of commands which is used to perform something. <summary> element provides summary of element.

2. Which element is known as Disclosure Summary element?
a) <dialog>
b) <summary>
c) <menu>
d) <menuitem>
View Answer

Answer: b
Explanation: <dialog> element in HTML represents a dialog box or other interactive component like window or an inspector. <summary> element is known as Disclosure Summary element. It specifies caption, summary or legend for <details> element’s disclosure box. This element only includes global attribute. This element may only be used as the first child of <details> element. <menuitem> represents a command which helps user to pop up through menu. <menu> is a group of commands which is used to perform something.

3. Which element represents group of commands that user can activate or perform?
a) <menuitem>
b) <menu>
c) <summary>
d) <details>
View Answer

Answer: b
Explanation: <menuitem> represents a command which helps user to pop up through menu. <menu> element in HTML represents group of commands that user can perform or activate. This include list menu as well as context menus. List menus appear across top of a screen and context menus might appear underneath a button after it has been clicked. <summary> element is known as Disclosure Summary element. <details> elment provides information that user can view or hide as per own wish.
advertisement
advertisement

4. Which of the following is not a web component element?
a) <shadow>
b) <element>
c) <content>
d) <menu>
View Answer

Answer: d
Explanation: There are web components in HTML related technology which makes it possible to essentially create and use custom elements as if it were regular HTML. You can also create custom versions of standard HTML elements. Some of the elements are <shadow>, <content>, <element>, <template>, <slot>.

5. Which of the following element is for holding client-side content?
a) <template>
b) <slot>
c) <element>
d) <content>
View Answer

Answer: a
Explanation: <template> element in HTML is a mechanism for holding client-side content that is not to be rendered when page is loaded but may subsequently be instantiated during runtime using JavaScript. The element includes global attributes. <slot> is a placeholder inside a web components. <element> is one of part of web components, used to custom DOM elements. The obsolete part of web components is <content>.

6. Which element is a placeholder inside web component?
a) <shadow>
b) <content>
c) <slot>
d) <element>
View Answer

Answer: c
Explanation: <shadow> is obsolete part of web component used to shadow DOM. The obsolete part of web components is <content>. <slot> element in HTML is a part of Web Components technology suite. It is a placeholder inside web component that you can fill with own markup that lets you create separate DOM trees and present them together. <element> is one of part of web components, used to custom DOM elements.

7. Which element is used for defining a new custom DOM elements?
a) <element>
b) <shadow>
c) <slot>
d) <content>
View Answer

Answer: a
Explanation: <element> is HTML obsolete element. It was the part of Web Components specification. It was intended to be used to define new custom DOM elements. It was removed in favor of JavaScript-driven approach for creating new custom elements. <shadow> is obsolete part of web component used to shadow DOM. <slot> element in HTML is a part of Web Components technology suite. The obsolete part of web components is <content>.
advertisement

8. Which element is not a obsolete?
a) <dir>
b) <command>
c) <center>
d) <caption>
View Answer

Answer: d
Explanation: Obsolete elements are old HTML elements which are deprecated and should not be used. They should never be used in new projects, and should replace them in old projects as soon as we can. <acronym>, <basefont>, <applet>, <big>, <bgsound>, <command>, <content>, <dir>, <center> are some of the obsolete elements.

9. Which element sets default font face, size and color for other elements?
a) <applet>
b) <basefont>
c) <big>
d) <acronym>
View Answer

Answer: b
Explanation: <applet> embeds java applet in web document. <basefont> is obsolete HTML element. It sets default font face, size, and color for other elements which are descended from its parent element. Instead of using this element we can use font, font-size, font-family and color to change font configuration for an element. <acronym> element which has been removed from HTML5 indicates sequence of characters. <big> element increase the font size.
advertisement

10. For background sound obsolete element was __________
a) <bgsound>
b) <audio>
c) <blink>
d) <acronym>
View Answer

Answer: a
Explanation: <bgsound> element only used by Internet Explorer is Background Sound element. It sets up a sound file to play in background while the page is used. We use <audio> instead of this element. <acronym> element which has been removed from HTML5 indicates sequence of characters. <blink> is a non-standard element which causes text to flash slowly. <audio> element is used to play audio clip.

11. Which element is used to show the text slowly?
a) <big>
b) <blink>
c) <center>
d) <audio>
View Answer

Answer: b
Explanation: <big> element increase the font size. <blink> element is non standard element in HTML. It causes enclosed text to flash slowly. But this element is unsupported and thus implements HTMLUnknownElement interface. <audio> element is used to play audio clip. <center> is block level element which centers element horizontally.

12. Which element is used as a container for a directory of files?
a) <dir>
b) <font>
c) <content>
d) <command>
View Answer

Answer: a
Explanation: <dir> element is used as a container for directory of files or folders, potentially with styles and icons applied by user agent. It is recommended not to use this element you can use <ul> element for lists including lists of files. Size, color or face for the content is defined by <font> element. Those commands that user can invoke are represented by <command>. <content> is an obsolete part of web components and is inside shadow DOM.

13. Which element puts a text field in a page for querying document?
a) <keygen>
b) <isiindex>
c) <dir>
d) <command>
View Answer

Answer: b
Explanation: An element which exists to facilitate generation of key material is <keygen>. <isindex> is an obsolete HTML element. It puts a text field in a page for querying the document. It is deprecated as of HTML 4.1, because same behavior can be achieved with HTML form. All major browsers have now removed <isindex>. <dir> contains list of directories. Those commands that user can invoke are represented by <command>.

14. Which element facilitate generation of key material?
a) <isindex>
b) <listing>
c) <keygen>
d) <marquee>
View Answer

Answer: c
Explanation: <isindex> is an obsolete HTML element. It puts a text field in a page for querying the document. <keygen> element exists to facilitate generation of key material and submission of public key as part of HTML form. It is designed to use with web-based certificate management systems. It includes all the global attributes like autofocus, challenge etc. The rendering of text between start tag and end tag is done by <listing> element. A scrolling text can be displayed by <marquee> element.

15. Which element is used for inserting scrolling area of text?
a) <marquee>
b) <menu>
c) <menuitem>
d) <multicol>
View Answer

Answer: a
Explanation: <menu> element in HTML represents group of commands that user can perform or activate. <menuitem> represents a command which helps user to pop up through menu. <marquee> element is used to insert scrolling area of text. You can control what happens when text reaches edges of its content area using its attributes. It includes the attributes behavior, bgcolor, height, hspace, loop etc. <multicol> is an experimental element designed to draw multi-colour layouts.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML Assessment Questions, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.