Multiple Choice Questions:
Multimedia Elements in HTML
Question 1
What HTML tag is used to embed a video into a web page?
a) <audio>
b) <video>
c) <iframe>
d) <embed>
Answer: b) <video>
Question 2
Which attribute of the <video> tag is used to specify that the video should start playing automatically?
a) autoplay
b) controls
c) loop
d) poster
Answer: a) autoplay
Question 3
How do you make an embedded audio file automatically play when the page loads?
a) controls="true"
b) loop="true"
c) autoplay="true"
d) src="audio.mp3"
Answer: c) autoplay="true"
Question 4
Which attribute of the <iframe> tag allows you to make an embedded video fill the entire screen?
a) allowfullscreen
b) frameborder
c) width
d) height
Answer: a) allowfullscreen
Question 5
To ensure a video in an <iframe> is responsive, which CSS property can you use to make sure it scales properly?
a) max-width: 100%;
b) width: 100%;
c) height: auto;
d) object-fit: cover;
Answer: a) max-width: 100%;
Question 6
What HTML tag is used to include a video from an external URL, like YouTube, in a web page?
a) <embed>
b) <video>
c) <iframe>
d) <object>
Answer: c) <iframe>
Question 7
Which attribute of the <audio> tag specifies that the audio file should play in a loop?
a) autoplay
b) loop
c) controls
d) preload
Answer: b) loop
Question 8
What is the purpose of the controls attribute in both the <video> and <audio> tags?
a) To make the element responsive
b) To add play, pause, and volume controls
c) To specify the media source
d) To autoplay the media
Answer: b) To add play, pause, and volume controls
Question 9
Which attribute of the <video> tag is used to provide an alternative image to be shown before the video starts playing?
a) poster
b) controls
c) autoplay
d) loop
Answer: a) poster
Question 10
When embedding a video with the <video> tag, which of the following attributes is not valid?
a) src
b) type
c) width
d) target
Answer: d) target
Question 11
To embed an interactive Google Map using the <iframe> tag, which attribute is important for making the map responsive?
a) border
b) style="border:0;"
c) height
d) allowfullscreen
Answer: b) style="border:0;"
Question 12
How can you ensure that a video file does not play automatically when the page loads?
a) Omit the autoplay attribute
b) Use autoplay="false"
c) Set loop="false"
d) Include controls="true"
Answer: a) Omit the autoplay attribute
Question 13
Which attribute is used to specify the media type of a video file in the <source> tag?
a) media
b) type
c) src
d) controls
Answer: b) type
Question 14
In which scenario would you use the <audio> tag?
a) To play background music
b) To display a video
c) To include interactive content
d) To embed a Google Map
Answer: a) To play background music
Question 15
What is the default behavior of a video embedded with the <video> tag if no controls attribute is provided?
a) The video will play automatically
b) The video will display a control bar for playback
c) The video will not display any controls
d) The video will loop indefinitely
Answer: c) The video will not display any controls
Question 16
Which attribute of the <audio> tag can be used to preload the audio file before playback?
a) preload
b) autoplay
c) loop
d) controls
Answer: a) preload
Question 17
What value of the preload attribute for the <audio> tag will load the audio file only when the user initiates playback?
a) auto
b) none
c) metadata
d) true
Answer: b) none
Question 18
Which HTML5 tag is used to specify the fallback content if the media type is not supported?
a) <fallback>
b) <source>
c) <embed>
d) <object>
Answer: b) <source>
Question 19
How can you embed a YouTube video on your web page using HTML?
a) Use the <video> tag with the YouTube URL
b) Use the <iframe> tag with the YouTube embed URL
c) Use the <embed> tag with the YouTube URL
d) Use the <object> tag with the YouTube URL
Answer: b) Use the <iframe> tag with the YouTube embed URL
Question 20
Which attribute of the <video> tag allows you to specify the poster image to show before the video starts playing?
a) src
b) controls
c) poster
d) autoplay
Answer: c) poster
Question 21
What does the muted attribute do in the <video> tag?
a) It disables the video playback
b) It hides the video controls
c) It silences the audio of the video
d) It sets the video to autoplay
Answer: c) It silences the audio of the video
Question 22
If you want to include a video that should play continuously, which attribute should you use?
a) autoplay
b) loop
c) controls
d) preload
Answer: b) loop
Question 23
To ensure that an <iframe> element containing a video is responsive, which CSS property is commonly used?
a) position: absolute;
b) max-width: 100%;
c) width: auto;
d) height: fixed;
Answer: b) max-width: 100%;
Question 24
Which of the following is NOT a valid attribute for the <video> tag?
a) poster
b) controls
c) audio
d) autoplay
Answer: c) audio
Question 25
Which HTML tag would you use to add an audio file with a download link to a web page?
a) <audio>
b) <video>
c) <embed>
d) <object>
Answer: a) <audio>
Question 26
How can you provide multiple video formats for compatibility with different browsers?
a) Use multiple <video> tags
b) Use multiple <source> tags inside a single <video> tag
c) Use the <object> tag with different formats
d) Use different URLs in the src attribute of the <video> tag
Answer: b) Use multiple <source> tags inside a single <video> tag
Question 27
Which attribute of the <iframe> tag is used to enable fullscreen mode for embedded content?
a) fullscreen
b) allowfullscreen
c) frameborder
d) scrolling
Answer: b) allowfullscreen
Question 28
What attribute would you use to provide a default image when a video is not available or fails to load?
a) fallback
b) poster
c) alt
d) src
Answer: b) poster
Question 29
Which attribute in the <audio> tag determines how much of the audio file is loaded when the page loads?
a) preload
b) controls
c) autoplay
d) loop
Answer: a) preload
Question 30
What is the purpose of the controls attribute in the <video> tag?
a) To make the video play automatically
b) To add a control bar with play, pause, and volume options
c) To specify the video source
d) To set the video dimensions
Answer: b) To add a control bar with play, pause, and volume options
Question 31
Which attribute of the <audio> tag allows you to provide fallback content if the audio file is not supported?
a) fallback
b) src
c) type
d) controls
Answer: b) src
Question 32
How do you specify the dimensions for an embedded <iframe>?
a) Use width and height attributes
b) Use size attributes
c) Use dimensions attributes
d) Use area attributes
Answer: a) Use width and height attributes
Question 33
What is the purpose of the type attribute in the <source> tag within a <video> or <audio> tag?
a) To specify the media type of the file for compatibility
b) To specify the file name
c) To set the file size
d) To define the playback speed
Answer: a) To specify the media type of the file for compatibility
Question 34
Which HTML element would you use to add an audio player to your web page?
a) <audio>
b) <sound>
c) <play>
d) <music>
Answer: a) <audio>
Question 35
What does the autoplay attribute do in the <video> tag?
a) It prevents the video from playing automatically
b) It plays the video as soon as it is loaded
c) It pauses the video
d) It controls the volume of the video
Answer: b) It plays the video as soon as it is loaded
Question 36
To embed a video with a specific aspect ratio, which CSS property is commonly adjusted?
a) border
b) object-fit
c) padding
d) margin
Answer: b) object-fit
Question 37
Which attribute in the <video> tag allows you to display video playback controls to the user?
a) controls
b) autoplay
c) loop
d) poster
Answer: a) controls
Question 38
What is the default behavior of an embedded video if neither autoplay nor controls attributes are specified?
a) The video will play automatically and display controls
b) The video will display controls but not play automatically
c) The video will not display controls and will not play automatically
d) The video will play automatically but not display controls
Answer: c) The video will not display controls and will not play automatically
Question 39
Which of the following is a valid MIME type for an MP4 video file?
a) video/mp4
b) video/x-mp4
c) audio/mp4
d) file/mp4
Answer: a) video/mp4
Question 40
How can you set a specific image to be shown while a video is buffering?
a) Use the poster attribute in the <video> tag
b) Use the src attribute in the <video> tag
c) Use the image attribute in the <video> tag
d) Use the cover attribute in the <video> tag
Answer: a) Use the poster attribute in the <video> tag
Question 41
Which HTML5 element allows embedding interactive content like maps and videos from other websites?
a) <object>
b) <embed>
c) <iframe>
d) <embed>
Answer: c) <iframe>
Question 42
What is the function of the loop attribute in the <audio> tag?
a) It stops the audio playback when it ends
b) It pauses the audio playback
c) It makes the audio repeat continuously
d) It controls the volume of the audio
Answer: c) It makes the audio repeat continuously
Question 43
To make a video responsive across different screen sizes, which CSS technique is typically used?
a) Fixed width and height
b) Percentage-based dimensions
c) Absolute positioning
d) Fixed positioning
Answer: b) Percentage-based dimensions
Question 44
Which HTML tag would you use to include a video from an external source that supports interactive content?
a) <embed>
b) <object>
c) <video>
d) <iframe>
Answer: d) <iframe>
Question 45
What attribute can you use to set the initial volume level for an audio element?
a) volume
b) initial-volume
c) audio-level
d) There is no direct attribute for setting initial volume
Answer: d) There is no direct attribute for setting initial volume
Question 46
Which attribute of the <video> tag specifies whether the video should be shown in fullscreen mode?
a) fullscreen
b) allowfullscreen
c) size
d) display
Answer: b) allowfullscreen
Question 47
What is the correct syntax to specify multiple sources for a video element to ensure compatibility across different browsers?
a) <video src="video.mp4" src="video.ogv">
b) <video> <source src="video.mp4" type="video/mp4"> <source src="video.ogv" type="video/ogg"> </video>
c) <video src="video.mp4, video.ogv">
d) <video> <source src="video.mp4" /> <source src="video.ogv" /> </video>
Answer: b) <video> <source src="video.mp4" type="video/mp4"> <source src="video.ogv" type="video/ogg"> </video>
Question 48
Which attribute is used to control the appearance of playback controls in the <audio> and <video> elements?
a) controls
b) display
c) play
d) manage
Answer: a) controls
Question 49
To embed a video with a poster image, which of the following attributes should be used?
a) poster
b) background
c) image
d) thumbnail
Answer: a) poster
Question 50
Which tag is used to include fallback content within a <video> element if the browser does not support the video format?
a) <fallback>
b) <source>
c) <object>
d) <embed>
Answer: b) <source>
Question 51
Which HTML attribute is used to provide a link to download an audio file?
a) download
b) href
c) src
d) url
Answer: a) download
Question 52
How can you ensure that an embedded video maintains a 16:9 aspect ratio across different screen sizes?
a) Use fixed width and height
b) Set width to 100% and height to auto
c) Use a 4:3 aspect ratio
d) Apply a margin to the video element
Answer: b) Set width to 100% and height to auto
Question 53
What should you use if you want to include a map with interactive features on your web page?
a) <audio>
b) <video>
c) <iframe>
d) <object>
Answer: c) <iframe>
Question 54
What is the default value for the autoplay attribute in the <audio> and <video> tags if it is not specified?
a) The media plays automatically
b) The media does not play automatically
c) The media plays in a loop
d) The media displays controls
Answer: b) The media does not play automatically
Question 55
Which attribute in the <video> tag makes the video display playback controls when the video is loaded?
a) autoplay
b) controls
c) loop
d) preload
Answer: b) controls
Question 56
Which of the following MIME types is used for MP3 audio files?
a) audio/mpeg
b) audio/mp3
c) audio/x-mp3
d) audio/mp4
Answer: a) audio/mpeg
Question 57
How can you ensure that an audio file does not play automatically but still allows users to control playback?
a) Omit the autoplay attribute and include controls
b) Use autoplay="false"
c) Set controls="false"
d) Use loop="true"
Answer: a) Omit the autoplay attribute and include controls
Question 58
What happens if the loop attribute is added to an <audio> element?
a) The audio file will play only once
b) The audio file will repeat continuously
c) The audio file will stop when finished
d) The audio file will play in reverse
Answer: b) The audio file will repeat continuously
Question 59
What is the function of the preload attribute in the <audio> and <video> tags?
a) It determines how much of the media file should be loaded when the page loads
b) It sets the media file to play automatically
c) It makes the media file loop indefinitely
d) It adjusts the volume level of the media file
Answer: a) It determines how much of the media file should be loaded when the page loads
Question 60
Which HTML tag would you use to embed an external video that supports interactive content, such as a Google Map?
a) <object>
b) <embed>
c) <iframe>
d) <video>
Answer: c) <iframe>
Question 61
Which attribute of the <video> tag can be used to set the initial playback state of the video?
a) loop
b) preload
c) autoplay
d) controls
Answer: c) autoplay
Question 62
Which tag should be used to include an audio file that is supported across most modern browsers?
a) <sound>
b) <audio>
c) <play>
d) <music>
Answer: b) <audio>
Question 63
What happens if you include the muted attribute in the <video> tag?
a) The video will be hidden
b) The video will play in reverse
c) The audio will be turned off
d) The video will display only in black and white
Answer: c) The audio will be turned off
Question 64
In which scenario is the controls attribute used in the <audio> and <video> tags?
a) To set a video or audio file to loop
b) To add playback controls to the media player
c) To make the media file play automatically
d) To set a default image to display
Answer: b) To add playback controls to the media player
Question 65
Which attribute of the <source> tag specifies the format of the media file?
a) format
b) type
c) media
d) src
Answer: b) type
Question 66
If a browser does not support a given video format, which HTML element can provide an alternative video source?
a) <object>
b) <video>
c) <source>
d) <embed>
Answer: c) <source>
Question 67
Which attribute is used to control whether a video should automatically start playing when the page loads?
a) play
b) autoplay
c) start
d) begin
Answer: b) autoplay
Question 68
What is the default behavior for the <video> tag if neither controls nor autoplay attributes are specified?
a) The video plays automatically with controls
b) The video does not play automatically and has no controls
c) The video displays controls and plays in a loop
d) The video starts playing in fullscreen mode
Answer: b) The video does not play automatically and has no controls
Question 69
What is the purpose of the poster attribute in the <video> tag?
a) To specify the file format
b) To display a placeholder image before the video starts playing
c) To set the default playback speed
d) To link to an external video source
Answer: b) To display a placeholder image before the video starts playing
Question 70
How can you embed a YouTube video on your web page?
a) Use the <video> tag with the YouTube URL
b) Use the <iframe> tag with the YouTube embed URL
c) Use the <object> tag with the YouTube URL
d) Use the <embed> tag with the YouTube URL
Answer: b) Use the <iframe> tag with the YouTube embed URL
Question 71
Which HTML5 element is used to display a video or audio file with interactive features from external sources?
a) <embed>
b) <object>
c) <iframe>
d) <media>
Answer: c) <iframe>
Question 72
What is the effect of adding the loop attribute to an <audio> tag?
a) The audio will play once and then stop
b) The audio will start over from the beginning after it ends
c) The audio will be muted
d) The audio will play in reverse
Answer: b) The audio will start over from the beginning after it ends
Question 73
Which attribute would you use to provide additional metadata about a video file, such as duration or dimensions?
a) metadata
b) preload
c) controls
d) type
Answer: b) preload
Question 74
Which of the following is a valid MIME type for an MP4 video file?
a) video/mpeg
b) video/mp4
c) video/avi
d) video/x-mp4
Answer: b) video/mp4
Question 75
What is the effect of the preload attribute set to "auto" in a <video> tag?
a) The video will not load until the user presses play
b) The video will load the entire file when the page loads
c) The video will load only the metadata
d) The video will only buffer a few seconds of playback
Answer: b) The video will load the entire file when the page loads
Question 76
What does the controls attribute do in the <audio> and <video> elements?
a) Adds a play/pause button
b) Sets the media to loop
c) Provides the user with playback controls like play, pause, and volume
d) Sets the media file to play automatically
Answer: c) Provides the user with playback controls like play, pause, and volume
Question 77
Which HTML5 tag is used to include an external video that supports interactive content and allows resizing?
a) <object>
b) <embed>
c) <iframe>
d) <video>
Answer: c) <iframe>
Question 78
If you want a video to start playing from a specific point when the page loads, which attribute should you use?
a) start
b) autoplay
c) time
d) play
Answer: b) autoplay
Question 79
Which attribute of the <video> tag specifies the default poster image displayed before the video starts playing?
a) poster
b) image
c) thumbnail
d) cover
Answer: a) poster
Question 80
Which attribute in the <audio> or <video> tag controls the media's playback volume?
a) volume
b) sound
c) audio-level
d) There is no direct attribute for setting the volume
Answer: d) There is no direct attribute for setting the volume
Question 81
What does the muted attribute do when used in the <audio> or <video> tag?
a) It turns off the media
b) It turns off the audio and prevents sound from being played
c) It reduces the media’s volume to the minimum level
d) It plays the media in a muted color scheme
Answer: b) It turns off the audio and prevents sound from being played
Question 82
Which attribute is used to make sure an embedded audio file will start playing as soon as it is loaded?
a) autoplay
b) start
c) loop
d) controls
Answer: a) autoplay
Question 83
To ensure that an <iframe> element is responsive and adjusts its size based on the width of its container, what CSS property is typically used?
a) width: 100%;
b) height: 100%;
c) resize: auto;
d) object-fit: cover;
Answer: a) width: 100%;
Question 84
Which HTML attribute in the <video> tag can be used to specify the video file’s source for different formats to ensure cross-browser compatibility?
a) src
b) type
c) source
d) file
Answer: b) type
Question 85
What is the effect of using the loop attribute with the <video> tag?
a) The video will play once and then stop
b) The video will play in reverse
c) The video will repeat from the beginning once it ends
d) The video will play continuously until manually stopped
Answer: c) The video will repeat from the beginning once it ends
Question 86
What is the primary purpose of the <source> tag within the <video> or <audio> tags?
a) To provide fallback content if the media file cannot be played
b) To specify multiple media sources for better browser compatibility
c) To define the dimensions of the media
d) To provide metadata about the media file
Answer: b) To specify multiple media sources for better browser compatibility
Question 87
What happens if you set the controls attribute in the <audio> tag?
a) The audio will play automatically
b) Playback controls like play, pause, and volume will be displayed
c) The audio will loop continuously
d) The audio will be muted
Answer: b) Playback controls like play, pause, and volume will be displayed
Question 88
Which HTML element can be used to include an audio file with a download option?
a) <audio>
b) <source>
c) <embed>
d) <a href="file.mp3" download>Download Audio</a>
Answer: d) <a href="file.mp3" download>Download Audio</a>
Question 89
Which attribute of the <iframe> tag is used to specify whether the iframe should be able to display content from a different origin?
a) src
b) frameborder
c) allowfullscreen
d) sandbox
Answer: d) sandbox
Question 90
What is the correct way to embed a YouTube video that plays automatically when the page loads?
a) Use the <video> tag with YouTube video URL and autoplay attribute
b) Use the <iframe> tag with the YouTube embed URL and autoplay=1 in the query string
c) Use the <object> tag with YouTube video URL and autoplay attribute
d) Use the <embed> tag with the YouTube video URL and autoplay attribute
Answer: b) Use the <iframe> tag with the YouTube embed URL and autoplay=1 in the query string