HTML Iframes — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the HTML Iframes lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Embed a page
easy10 minAdd an iframe pointing at /widget.
- 2
Title the frame
easy10 minGive the iframe an accessible title.
- 3
Size the frame
easy10 minGive the iframe a width and height.
- 4
Lazy-load the frame
easy10 minDefer loading until the frame is near the viewport.
- 5
Sandbox untrusted content
medium10 minAdd a sandbox attribute allowing scripts only.
Find the bug(5)
- 1
Fix the missing title
easy8 minScreen reader users cannot tell what the frame contains.
- 2
Fix the wrong source attribute
easy8 minAn iframe uses src, not href.
- 3
Fix the unsandboxed third-party frame
easy8 minUntrusted embeds should be sandboxed.
- 4
Fix the eager offscreen frame
easy8 minA frame below the fold should lazy-load.
- 5
Fix the deprecated frameborder
easy8 minUse CSS for borders instead of frameborder.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace