0
0
HTMLmarkup~20 mins

Video tag basics in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Video Tag Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What will this video tag display?
Look at this HTML code for a video. What will you see in the browser?
HTML
<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>
AA video player with controls that plays movie.mp4 if supported.
BJust the text 'Your browser does not support the video tag.' with no video player.
CA blank box with no controls or video.
DAn error message displayed by the browser.
Attempts:
2 left
💡 Hint
Think about what the
📝 Syntax
intermediate
2:00remaining
Which option correctly adds autoplay to a video?
You want the video to start playing automatically when the page loads. Which code snippet does this correctly?
A
&lt;video controls autoplay="true"&gt;
  &lt;source src="clip.mp4" type="video/mp4"&gt;
&lt;/video&gt;
B
&lt;video autoplay controls&gt;
  &lt;source src="clip.mp4" type="video/mp4"&gt;
&lt;/video&gt;
C
&lt;video controls autoplay="autoplay"&gt;
  &lt;source src="clip.mp4" type="video/mp4"&gt;
&lt;/video&gt;
D
&lt;video controls autoplay="yes"&gt;
  &lt;source src="clip.mp4" type="video/mp4"&gt;
&lt;/video&gt;
Attempts:
2 left
💡 Hint
The autoplay attribute is a boolean attribute in HTML5.
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.
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?
HTML
<video controls src="sample.mp4"></video>
Avideo { width: 100%; height: auto; max-width: 600px; }
Bvideo { width: 600px; height: 400px; }
Cvideo { max-width: 100%; height: 100%; }
Dvideo { width: auto; height: auto; }
Attempts:
2 left
💡 Hint
Think about keeping the video width flexible but not too large.
🧠 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.