Give a video one source element with its type.
Acceptance criteria
- 1.Give a video one source element with its type.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <source> Tag chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “offers the browser a choice. Inside , or , you list several versions of the same image or media — different formats, sizes, or crops — and the browser takes the first one it can use. Order matters, and the fallback is not optional.” .
1.Add a sourceexercise · easy · 10 min
Give a video one source element with its type.
Passes when: Give a video one source element with its type.
2.Offer two formatsexercise · easy · 10 min · practice plan
Provide two sources so the browser can pick one.
Passes when: Provide two sources so the browser can pick one.
3.An audio sourceexercise · easy · 10 min · practice plan
Give an audio element a typed source.
Passes when: Give an audio element a typed source.
4.A picture sourceexercise · easy · 10 min · practice plan
Use a source inside a picture to offer a wider image.
Passes when: Use a source inside a picture to offer a wider image.
5.Sources with a fallbackexercise · medium · 10 min · practice plan
Two video sources plus a message for old browsers.
Passes when: Two video sources plus a message for old browsers.
6.Fix the missing typebug fix · easy · 8 min
Without a type the browser must download to find out.
Passes when: Without a type the browser must download to find out.
7.Fix the missing second formatbug fix · easy · 8 min · practice plan
Only one format was offered.
Passes when: Only one format was offered.
8.Fix the wrong type for audiobug fix · easy · 8 min · practice plan
An MP3 is audio/mpeg, not video.
Passes when: An MP3 is audio/mpeg, not video.
9.Fix the picture source using srcbug fix · easy · 8 min · practice plan
Inside a picture, a source uses srcset.
Passes when: Inside a picture, a source uses srcset.
10.Fix the fallback placed before the sourcesbug fix · easy · 8 min · practice plan
Fallback text comes after the source elements.
Passes when: Fallback text comes after the source elements.
Between them these tasks cover Multiple formats, type attribute and Fallback order.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.