MCQs on Images and Multimedia Basics | HTML

Chapter 6 of HTML, covering Images and Multimedia Basics, is essential for building rich, interactive websites. It delves into adding images using <img>, image attributes, video and audio embedding with <video> and <audio>, and related concepts like sizing. This knowledge is crucial for modern web design and development. Below are 30 multiple-choice questions (MCQs) to help you assess your understanding of this topic.


MCQs on “Images and Multimedia Basics in HTML”

Section 1: Adding Images (<img>)

  1. What does the <img> tag in HTML represent?
    • a) A link
    • b) An image
    • c) A video
    • d) An audio file
  2. Which attribute of the <img> tag specifies the image source?
    • a) href
    • b) src
    • c) alt
    • d) link
  3. The alt attribute in an <img> tag is used for:
    • a) Providing the image title
    • b) Specifying image size
    • c) Displaying alternative text for accessibility
    • d) Determining image location
  4. How do you make an image appear as a link in HTML?
    • a) By using the <link> tag
    • b) By wrapping the <img> tag inside an <a> tag
    • c) By using the href attribute inside <img>
    • d) By setting the image’s background property
  5. Which of the following is a correct example of an <img> tag in HTML?
    • a) <img alt="flower" src="flower.jpg">
    • b) <img href="flower.jpg" alt="flower">
    • c) <img source="flower.jpg" alt="flower">
    • d) <img link="flower.jpg" alt="flower">
  6. What happens if the alt attribute is not included in an <img> tag?
    • a) The image will not be displayed
    • b) The page will break
    • c) The image will display a broken link icon
    • d) Nothing will happen; it’s optional
  7. How would you prevent an image from being stretched when resizing it?
    • a) Set both width and height attributes to auto
    • b) Use the object-fit property
    • c) Use image-width and image-height
    • d) Use the size property
  8. The width and height attributes in an <img> tag specify:
    • a) The resolution of the image
    • b) The dimensions in pixels
    • c) The file size of the image
    • d) The border around the image
  9. To make an image responsive (scale with screen size), which CSS property is typically used?
    • a) max-width: 100%;
    • b) width: 100%;
    • c) display: flex;
    • d) object-fit: contain;
  10. Which of the following is a valid image file format supported in HTML?
    • a) .html
    • b) .jpg
    • c) .css
    • d) .js

Section 2: Image Sizing

  1. The object-fit property is used to control:
    • a) Image compression
    • b) How an image is resized to fit its container
    • c) The image’s background color
    • d) The image alignment
  2. How can you set a fixed width for an image while keeping its aspect ratio intact?
    • a) Set only the width property, leave height blank
    • b) Set both width and height properties
    • c) Use object-fit: fill
    • d) Set both width and height to auto
  3. What does the max-width property ensure when applied to an image?
    • a) It prevents the image from exceeding the specified width
    • b) It fixes the height of the image
    • c) It adds a border around the image
    • d) It makes the image stretch to fit the container
  4. Which CSS property would you use to center an image horizontally?
    • a) text-align: center;
    • b) align-content: center;
    • c) margin: 0 auto;
    • d) position: absolute;
  5. Which value of object-fit property will make the image fill the container while preserving its aspect ratio?
    • a) contain
    • b) cover
    • c) fill
    • d) none

Section 3: Adding Simple Videos and Audios (<video> and <audio>)

  1. Which tag is used to add video content in HTML?
    • a) <media>
    • b) <video>
    • c) <movie>
    • d) <film>
  2. What attribute is used to specify the video file in the <video> tag?
    • a) src
    • b) type
    • c) file
    • d) srcfile
  3. The <audio> tag is used for:
    • a) Displaying audio controls
    • b) Embedding video content
    • c) Adding audio files to the page
    • d) Displaying image captions
  4. Which attribute would you use to autoplay a video as soon as the page loads?
    • a) autoplay
    • b) play
    • c) start
    • d) auto
  5. What is the correct syntax to embed an audio file in HTML?
    • a) <audio src="audio.mp3" controls>
    • b) <audio file="audio.mp3" controls>
    • c) <audio controls src="audio.mp3">
    • d) <audio control="audio.mp3" src="audio.mp3">
  6. Which tag would you use to add multiple video formats for compatibility in HTML?
    • a) <video>
    • b) <source>
    • c) <files>
    • d) <formats>
  7. How would you enable controls (play, pause, etc.) for a video element?
    • a) By adding the controls attribute to the <video> tag
    • b) By using JavaScript functions
    • c) By adding autoplay and loop attributes
    • d) By adding the play attribute
  8. To make an audio or video file play continuously in a loop, which attribute should you use?
    • a) loop
    • b) repeat
    • c) auto-loop
    • d) replay
  9. Which of the following is a valid file format for embedding video using the <video> tag?
    • a) .docx
    • b) .mp4
    • c) .html
    • d) .js
  10. What is the purpose of the <source> tag inside a <video> or <audio> element?
    • a) To specify alternative formats of the media file for better compatibility
    • b) To provide metadata about the file
    • c) To display a source URL
    • d) To add a title to the media file
  11. What does the controls attribute do in a video tag?
    • a) It allows users to adjust video settings
    • b) It makes the video loop continuously
    • c) It adds a play/pause, volume, and progress bar interface
    • d) It makes the video play automatically
  12. Which file type is supported by the <audio> tag for embedding sound?
    • a) .mp3
    • b) .avi
    • c) .html
    • d) .png
  13. The poster attribute is used in the <video> tag to:
    • a) Define the first frame of the video shown before it plays
    • b) Add a logo to the video
    • c) Make the video responsive
    • d) Set a play button on the video
  14. How do you mute a video or audio element by default?
    • a) Set muted="true"
    • b) Use muted="false"
    • c) Use volume="0"
    • d) Set auto-play="true"
  15. What is the correct HTML syntax to add multiple <source> elements within a <video> tag for different formats?
    • a) <video><source src="video.mp4" type="video/mp4"><source src="video.ogv" type="video/ogv"></video>
    • b) <video src="video.mp4"><source src="video.ogv" type="video/ogv"></video>
    • c) <video><source type="video/mp4" src="video.mp4"></video>
    • d) <video><source src="video.mp4" type="video/mp4" /><source src="video.ogv" type="video/ogv"></video>

Answer Key (Tabular Form)

QnoAnswer
1b) An image
2b) src
3c) Displaying alternative text for accessibility
4b) By wrapping the <img> tag inside an <a> tag
5a) <img alt="flower" src="flower.jpg">
6d) Nothing will happen; it’s optional
7b) Use the object-fit property
8b) The dimensions in pixels
9b) width: 100%;
10b) .jpg
11b) How an image is resized to fit its container
12a) Set only the width property, leave height blank
13a) It prevents the image from exceeding the specified width
14c) margin: 0 auto;
15b) cover
16b) <video>
17a) src
18c) Adding audio files to the page
19a) autoplay
20a) <audio src="audio.mp3" controls>
21b) <source>
22a) By adding the controls attribute to the <video> tag
23a) loop
24b) .mp4
25a) To specify alternative formats of the media file for better compatibility
26c) It adds a play/pause, volume, and progress bar interface
27a) .mp3
28a) Define the first frame of the video shown before it plays
29a) Set muted="true"
30a) <video><source src="video.mp4" type="video/mp4"><source src="video.ogv" type="video/ogv"></video>

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top