Challenge - 5 Problems
Audio Tag Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What will this audio tag do in the browser?
Consider this HTML code:
What will the user see or experience when this code runs in a modern browser?
<audio src="song.mp3" controls></audio>
What will the user see or experience when this code runs in a modern browser?
HTML
<audio src="song.mp3" controls></audio>
Attempts:
2 left
💡 Hint
The controls attribute adds visible buttons for the user.
✗ Incorrect
The
🧠 Conceptual
intermediate2:00remaining
What does the 'autoplay' attribute do in an audio tag?
Given this audio tag:
What happens when the page loads?
<audio src="music.mp3" autoplay></audio>
What happens when the page loads?
HTML
<audio src="music.mp3" autoplay></audio>
Attempts:
2 left
💡 Hint
Autoplay means play without user action.
✗ Incorrect
The autoplay attribute tells the browser to start playing the audio as soon as it can, without waiting for the user to press play.
📝 Syntax
advanced2:30remaining
Which audio tag syntax correctly includes multiple source formats?
You want to provide an audio file in both MP3 and OGG formats for better browser support. Which code snippet is correct?
Attempts:
2 left
💡 Hint
Use multiple tags inside the audio tag.
✗ Incorrect
The correct way is to use multiple elements inside the
❓ accessibility
advanced2:00remaining
How to make an audio player accessible for screen readers?
Which attribute or technique improves accessibility for an audio player?
HTML
<audio controls src="podcast.mp3"></audio>
Attempts:
2 left
💡 Hint
Screen readers need descriptive labels.
✗ Incorrect
Adding aria-label gives screen readers a meaningful description of the audio content, helping users understand what they will hear.
❓ layout
expert3:00remaining
How to center an audio player horizontally and make it responsive?
You want the audio player to be centered on the page and adjust its width on small screens. Which CSS snippet achieves this best?
HTML
<audio controls src="music.mp3"></audio>
Attempts:
2 left
💡 Hint
Use block display and auto margins for centering.
✗ Incorrect
Setting display to block makes the audio element behave like a block. margin-inline: auto centers it horizontally. Width 100% with max-width limits size on large screens and allows shrinking on small screens.