Web Technology Questions and Answers – Image Maps

This set of Web Technology Multiple Choice Questions & Answers (MCQs) focuses on “Image Maps”.

1. Why are Images often used on the webpage?
a) Webpage cannot run/be displayed without at least one image
b) To create graphical buttons or links to other pages
c) Because webpage doesn’t support pure text
d) To help the webpage load efficiently
View Answer

Answer: b
Explanation: Images are also used for better presentation of webpage. Any image can be turned into a link. Rather than putting text between the opening < a > tag and the closing < /a > tag, you simply place an image inside these tags.

2. How are Image Maps helpful?
a) They allow you to add multiple links to the same image, with each link pointing to a different page
b) They allow you to add multiple links to same image, with each link pointing to same part of the page
c) They take care that no link messes up with the other link in the same webpage
d) They help in managing the image directories
View Answer

Answer: a
Explanation: They are particularly helpful when the image needs to be divided up in irregular shapes (such as maps). Each of these clickable areas is known as a hotspot. They are a type of image which acts as a link.

3. How does Image Maps work?
a) They work based on how they are places between the <a> elements
b) They work based on the directory an image is placed in
c) They work based on x and y coordinates
d) They work based on the available white space in a webpage
View Answer

Answer: c
Explanation: They are measured from the top left – hand corner of the image. The coordinates are used in two ways. To specify where the hotspots are and the other one is to work out where the user is clicking on the image.
advertisement
advertisement

4. How many types of Image Maps are existing?
a) Image Maps cannot be classified
b) Two
c) Four
d) Six
View Answer

Answer: b
Explanation: There are actually two types of image maps, both of which do the same job. The difference is how they work out which hotspot you clicked on. Client-side Image Maps and Server-side Image Maps are the two kinds of Image Maps existing.

5. Which of the following is not true about Client-side Image maps?
a) The web browser works out which part of the image the user has clicked on and takes the user to the appropriate page
b) Using the < map > and < area > elements inside an < img > element, Client-side Image map is created
c) Using the < map > element inside the < object > element, Client-side Image map is created
d) Client has an option to modify or create a Client-side Image map
View Answer

Answer: d
Explanation: Client – side image maps use XHTML code to tell the browser how the image will be divided up. The browser can tell what part of the image someone clicks on and can send the user to the appropriate link. Client cannot create or modify a Client-side Image map.

6. With what does an usemap attribute begin?
a) Begins with a pound or hash sign
b) It begins with a question mark sign after the previous attribute used
c) Equal to followed by double inverted commas
d) It begins with a dollar sign separating the previous attribute
View Answer

Answer: a
Explanation: The usemap attribute is followed by the value of the name attribute on the < map > element it uses. The usemap attribute is used to indicate that this image needs to use the information held in the corresponding < map > element.

7. Which of the following is not true about <map> element?
a) The < map > element usually follows directly after the < img > element
b) It needs to carry only the name attribute to identify itself
c) The < map > element then contains two or more < area > elements that actually define the clickable hotspots
d) The < map > element should be followed by another < map > element immediately
View Answer

Answer: d
Explanation: It is not necessary for a < map > element to follow another < map > element immediately. The < map > element then contains the information used to tell the browser how to split up the image so that it can send the user to the correct page.
advertisement

8. What is the default value if the shape attribute is not specified?
a) Circle
b) Square
c) Rectangle
d) triangle
View Answer

Answer: c
Explanation: The value of the shape attribute actually affects how the browser will use the coordinates specified in the coords attribute. The shape attribute will take the rectangle as value by default if no shape is mentioned. It’s better to use the abbreviated value of the shapes.

9. What is the function of the coords attribute?
a) Indicates what kind of shape the hotspot will be
b) Specifies the area that is the clickable hotspot
c) Help to build a clickable hotspot
d) To specify the non-clickable part
View Answer

Answer: b
Explanation: The number of coordinates you specify depends on the shape you are creating. The value default should be used on the last < area > element if you want to indicate any sections of the image. Rather than indicating the shape of the hotspot, this attribute specifies the area which is clickable.
advertisement

10. What is the value of coords attribute for a circle?
a) Infinity
b) Zero
c) Three
d) Five
View Answer

Answer: c
Explanation: A circle contains three coordinates. Therefore, the value of coords attribute is three. The first two are the center of the circle, while the third is the radius in pixels.

11. How many coordinates does in polygon have for the coords attribute?
a) One
b) Five
c) Seven
d) Depends on the shape
View Answer

Answer: d
Explanation: A polygon contains two coordinates for each point of the polygon. So, a triangle would contain six coordinates, a pentagon would contain ten, and so on. You do not need to specify the first coordinates again at the end because the shape is automatically closed.

12. If you have two areas that overlap each other, which one among the two in the code will take precedence?
a) The first one
b) The second one
c) Depends on the priority given
d) Efficiently written code
View Answer

Answer: a
Explanation: The first code will take the precedence among the two areas which are overlapping. The order of the code written is given the priority in such cases. There are some web authoring and image – editing programs will help work out the coordinates of an image map for you.

13. What is nohref used for?
a) Its value is the URL of the page you want to load when the user clicks that part of the image
b) To not to link a part of an image to anywhere
c) To create a duplicate link of an image
d) To cross the links if they are redirecting to the same webpage
View Answer

Answer: b
Explanation: You should use the nohref attribute on the specific space to indicate that the area will not take you anywhere. If you use this attribute, you should give it a value of nohref. The sytax of nohref attribute is nohref=”nohref”.

14. How does the target attribute help when mentioned in the code?
a) Specifies a text alternative for that section of the image
b) Specifies the order in which users can tab through items on a page
c) Specifies the destination webpage is ready for redirecting
d) Specifies which frame or window the page should be loaded into
View Answer

Answer: d
Explanation: Possible values are the same as for the target attribute of the < a > element. So, it specifies the frame and window for a webpage. The code target=”self” helps to load in the same frame or webpage.

15. The ismap attribute is used in _______
a) client-side image Maps
b) client image Maps
c) server-side image Maps
d) server image Maps
View Answer

Answer: c
Explanation: It tells the browser to send the server x , y coordinates representing what part of the image the user’s mouse was on when the user clicked the image map. Then a script on the server is used to determine which page the user should be sent to, based on the coordinates fed to it.

Sanfoundry Global Education & Learning Series – Web Technology.

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

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.