Use an embed element for a PDF.
Acceptance criteria
- 1.Use an embed element for a PDF.
HTML Tutorial · HTML Images and Media
These 10 tasks go with the HTML Embed & Object 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: “HTML provides the and elements to include external content in web pages, such as PDFs, multimedia files, or interactive applications. These elements allow you to integrate non-HTML content seamlessly, giving your website rich functionality beyond standard images, audio, or video.” .
1.Embed a documentexercise · easy · 10 min
Use an embed element for a PDF.
Passes when: Use an embed element for a PDF.
2.Use an objectexercise · easy · 10 min · practice plan
Embed a PDF using object with a data attribute.
Passes when: Embed a PDF using object with a data attribute.
3.Add fallback contentexercise · easy · 10 min · practice plan
Give the object a fallback message.
Passes when: Give the object a fallback message.
4.Size the embedexercise · easy · 10 min · practice plan
Give the embed a width and height.
Passes when: Give the embed a width and height.
5.Prefer a link for downloadsexercise · medium · 10 min · practice plan
Offer the file as a download link alongside the object.
Passes when: Offer the file as a download link alongside the object.
6.Fix src used on objectbug fix · easy · 8 min
An object points at its resource with data.
Passes when: An object points at its resource with data.
7.Fix data used on embedbug fix · easy · 8 min · practice plan
An embed uses src, not data.
Passes when: An embed uses src, not data.
8.Fix the missing typebug fix · easy · 8 min · practice plan
Without a type the browser may not know how to render it.
Passes when: Without a type the browser may not know how to render it.
9.Fix the object with no fallbackbug fix · easy · 8 min · practice plan
Add content for browsers that cannot render it.
Passes when: Add content for browsers that cannot render it.
10.Fix the deprecated appletbug fix · easy · 8 min · practice plan
The applet element was removed from HTML.
Passes when: The applet element was removed from HTML.
Between them these tasks cover embed, object and Fallback content.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.