The autoplay attribute is a boolean attribute in HTML5.
✗ Incorrect
In HTML5, boolean attributes like autoplay do not need a value. Just writing autoplay is enough. Adding values like 'true' or 'yes' is not standard and may not work.
❓ accessibility
advanced
2:00remaining
How to make a video accessible for screen readers?
Which option best improves accessibility for a video element so screen readers understand it?
AAdd an alt attribute with a description of the video.
BAdd a longdesc attribute with a link to a transcript.
CAdd a title attribute with the video file name.
DAdd a <track> element with kind="captions" and a label describing the captions.
Attempts:
2 left
💡 Hint
Think about how captions help deaf or hard-of-hearing users.
✗ Incorrect
The
❓ layout
advanced
2:00remaining
How to make a video responsive using CSS?
You want the video to resize nicely on different screen sizes. Which CSS snippet achieves this?
Think about keeping the video width flexible but not too large.
✗ Incorrect
Setting width to 100% and height to auto makes the video scale with its container width while keeping the aspect ratio. max-width limits the maximum size on large screens.
🧠 Conceptual
expert
3:00remaining
What happens if multiple tags are used inside a video?
Consider this code snippet:
What is the browser's behavior?
AThe browser randomly picks one source to play.
BThe browser plays all sources one after another automatically.
CThe browser tries to play the first supported source in order and ignores the rest.
DThe browser shows an error because multiple sources are not allowed.
Attempts:
2 left
💡 Hint
Think about how browsers handle different video formats for compatibility.
✗ Incorrect
Browsers check each in order and use the first one they support. This allows providing multiple formats for better compatibility.
Practice
(1/5)
1. What is the main purpose of the <video> tag in HTML?
easy
A. To embed videos directly on a webpage
B. To create audio playlists
C. To add images to a webpage
D. To style text content
Solution
Step 1: Understand the role of the <video> tag
The <video> tag is designed to embed video content directly into HTML pages.
Step 2: Compare with other options
Options A, B, and C relate to audio, images, and text styling, which are not the purpose of <video>.
Final Answer:
To embed videos directly on a webpage -> Option A
Quick Check:
<video> tag = embed videos [OK]
Hint: Remember: <video> is for videos, not audio or images [OK]
Common Mistakes:
Confusing <video> with <audio> tag
Thinking <video> adds images
Assuming <video> styles text
2. Which of the following is the correct way to add playback controls to a video using the <video> tag?
easy
A. <video src="movie.mp4" play></video>
B. <video src="movie.mp4" playcontrols></video>
C. <video src="movie.mp4" control></video>
D. <video src="movie.mp4" controls></video>
Solution
Step 1: Identify the correct attribute for controls
The correct attribute to add playback controls is controls without any extra letters.
Step 2: Check each option's attribute spelling
<video src="movie.mp4" controls></video> uses controls correctly; others have incorrect or non-existent attributes.
Final Answer:
<video src="movie.mp4" controls></video> -> Option D
Quick Check:
Use controls attribute to add buttons [OK]
Hint: Use exactly 'controls' attribute to show video buttons [OK]
Common Mistakes:
Misspelling 'controls' as 'control' or 'playcontrols'
Using non-existent attributes like 'play'
Forgetting to close the video tag properly
3. What will the following HTML code do when opened in a modern browser?
<video controls>
<source src="video.webm" type="video/webm">
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
medium
A. Show error message and no video
B. Play video.mp4 only, ignoring video.webm
C. Play video.webm if supported, else video.mp4
D. Play both videos simultaneously
Solution
Step 1: Understand multiple <source> tags in <video>
The browser tries each <source> in order and plays the first supported format.
Step 2: Analyze the source order and browser support
If the browser supports WebM, it plays video.webm; otherwise, it falls back to video.mp4.
Final Answer:
Play video.webm if supported, else video.mp4 -> Option C
Quick Check:
Multiple sources = fallback to supported video [OK]
Hint: Browser picks first supported source in order [OK]
B. The src attribute should not be used with <source> tags inside <video>
C. The <source> tag is missing a closing slash
D. The <video> tag cannot have multiple sources
Solution
Step 1: Understand usage of src and <source> tags
When using multiple <source> tags, the src attribute on <video> should be omitted to avoid conflicts.
Step 2: Check other options for errors
controls is spelled correctly, <source> tags do not require closing slashes in HTML5, and multiple sources are allowed.
Final Answer:
The src attribute should not be used with <source> tags inside <video> -> Option B
Quick Check:
Use either src or <source>, not both [OK]
Hint: Don't mix video src attribute with source tags [OK]
Common Mistakes:
Using src on video with source tags
Thinking <source> needs closing slash
Believing controls attribute is misspelled
5. You want to embed a video that automatically plays, loops, and is muted by default for better user experience. Which of the following is the correct <video> tag to achieve this?
hard
A. <video src="clip.mp4" autoplay loop muted></video>
B. <video src="clip.mp4" autoplay muted></video>
C. <video src="clip.mp4" autoplay loop controls></video>
D. <video src="clip.mp4" loop controls></video>
Solution
Step 1: Identify required attributes for autoplay, loop, and mute
The attributes autoplay, loop, and muted enable automatic play, repeating, and silent start respectively.
Step 2: Check which option includes all three without extra controls
<video src="clip.mp4" autoplay loop muted></video> has all three attributes and no controls, matching the requirement exactly.
Final Answer:
<video src="clip.mp4" autoplay loop muted></video> -> Option A
Quick Check:
Use autoplay, loop, muted together for silent looping video [OK]
Hint: Combine autoplay, loop, muted attributes for silent looping video [OK]
Common Mistakes:
Forgetting muted causes autoplay to block
Adding controls when not needed
Missing one of the required attributes
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.