HTML Questions & Answers – Using Image Sprites & Standardizing Client-Side Te…

This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “Using Image Sprites & Standardizing Client-Side Templating”.

1. Sprites are _____________
a) 1-D images
b) 2-D images
c) 3-D images
d) not the image
View Answer

Answer: b
Explanation: 2-D images are sprites. Sprite is a big image which is made up of combining small images into one larger image. It is defined by X and Y coordinates. CSS background-position property is used to define the exact position that is to be displayed.

2. Sprites are not used for _________
a) beautify the web page
b) reducing HTTP request
c) reduce loading time
d) reducing multiple server requests
View Answer

Answer: a
Explanation: If there are so many small icons, images, buttons etc. on the web page it will take more time to load the web page. Hence image sprites are used, it combines small images in one and loading time is reduced. This also reduces the HTTP request.

3. Each image in sprite should be approximately of ___________
a) 100 pixels
b) 20 pixels
c) 10 pixels
d) 50 pixels
View Answer

Answer: c
Explanation: For using image sprite we should try to round up to nearly 10 pixels, especially when working with Photoshop. We should also use simpler figures so that it will be easy to use ‘snap-to’ grids in photoshop, also for keeping things organized.
advertisement
advertisement

4. Which of the following is not Sprite Sheet generator?
a) Lemonade
b) Firewoks CS6
c) SpriteMe
d) Pixelomator
View Answer

Answer: d
Explanation: There are many sprite sheet generators such as Lemonade, Compass, SpriteMe, Fireworks CS6. Lemonade, Compass, and SpriteMe are available free of cost but Fireworks CS6 is not free of cost. Pixelomator is image editing software.

5. Which is the best platform for working with the individual image?
a) SpriteMe
b) Fireworks CS6
c) Lemonade
d) Compass
View Answer

Answer: a
Explanation: SpriteMe is brilliant sprite sheet viewer and generator. It is available at a free of cost. We can design our website using individual images. It is very simple to use. By using SpriteMe we can also view current sprite sheets that are already present on a website.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following does not generate a sprite sheet?
a) SpriteRight
b) Sprite Cow
c) CSS Sprites
d) Glue
View Answer

Answer: b
Explanation: Sprite Cow does not generate sprites, instead it helps to get the dimensions of images that are within sprite sheet, SpriteRight is used for generating sprite sheets., here the CSS is created on the fly. CSS Sprites is also one of the sprite sheet generators. Glue is a command line tool that generates sprite sheets.

7. Templates can’t be placed inside ______________
a) <head>
b) <body>
c) <table>
d) <form>
View Answer

Answer: d
Explanation: Templates can be placed inside <body>, <head>, <frameset>. Template can contain any type of elements. Template can be used as a child of <select> and <table> elements.

advertisement
<table> <tr> <template id=“teeds”> <td>..content..</td> </template> </tr> </table>

advertisement

8. The .content property is __________
a) read-only
b) write-only
c) read-write
d) hidden
View Answer

Answer: a
Explanation: The .content property is a read-only property i.e a DocumentFragment which contains guts of template.

function support_temp() {return ‘content’ in document.createElement(‘template’);} if (supportsTemplate()) {//go !} else {//use another templating technique.}

9. <template> does not include the attribute ___________
a) id
b) hidden
c) lang
d) src
View Answer

Answer: d
Explanation: <template> only include global attributes. Id, hidden, lang, onsubmit, ontoggle, onwaiting, onplay, onmousemove, onmousedown, onblur, oncancel, oncanplay, onabort, title etc. are some of the global attributes.

10. Which browser does not support <template> element?
a) Chrome
b) Firefox
c) Internet Explorer
d) Opera
View Answer

Answer: c
Explanation: On desktop <template> element is supported by most of the browser like Chrome, Edge, Opera, Safari, Firefox. Internet Explorer does not support this element. On mobile, it is supported by Edge mobile, Firefox for Android and iOS Safari.

11. Which of the following is not DOM property?
a) element.appendChild(node)
b) document.createElement()
c) element.innerHTML
d) document.getElementById()
View Answer

Answer: d
Explanation: For generating DOM we use certain DOM properties or methods. Some of the DOM methods are element.appendChild(node), document.createElement(), element.innerHTML, document.removeElement().

12. Which of the following is not a template library?
a) Mustache
b) Underscore JS library
c) Live.js
d) Handlebars
View Answer

Answer: c
Explanation: There are templating libraries like Handlebars, Mustache, Underscore JS library. Handlebars are like regular HTML which is embedded with handlebars expressions, Mustache is used with JavaScript, Underscore JS library is one of the JavaScript libraries which provides various useful functional programming.

13. Which process is used for the creation of the end result?
a) render()
b) compile()
c) eval(x)
d) encodeURI()
View Answer

Answer: a
Explanation: render() process creates the end result by putting actual data in the template. It means that the placeholders are replaced with the previous actual data, compile() is used for translating and compiling a template into a JavaScript function.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML, 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.