CHOOSE ANY STEP
FREECODECAMP / HTML / STEP 3 OF 8
freeCodeCamp: Build a Video Display Using iframe, Step 3
Set the frame dimensions
Written guidance is free. Step videos are a member benefit.
Add width and height to the opening iframe tag. Set width to five hundred sixty and height to three hundred fifteen, with each number inside quotation marks. Keep the closing tag below.
ORIGINAL WALKTHROUGH ·
Watch with Rob.
Watch the explanation, then apply the change and run the official checks on freeCodeCamp.
You are signed in, but video access needs attention. Check your account access. Your saved work is kept.
Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.
Your goals for this step
- Apply the requirements for “Set the frame dimensions” while keeping the earlier page structure.
- Explain width and the role it plays in this change.
- Explain height and the role it plays in this change.
- Compare the expected preview with your work before running the official checks.
THE TASK
What step 3 asks you to do
- Your
iframeelement should have awidthattribute set to560. - Your
iframeelement should have aheightattribute set to315.
Based on the official freeCodeCamp step 3 instructions (opens in a new tab).
Why this works
This is step 3 in freeCodeCamp’s video display workshop. Let’s make one change and check the result. Find the opening iframe tag beneath the heading. The width and height attributes set the display area reserved for the embedded document.
What you should see in the preview
The empty frame should now be wider and taller in the preview. These values reserve a five hundred sixty by three hundred fifteen pixel area. We are showing a scaled overview so the whole frame fits beside the code. It is still empty because there is no source address.
Illustrative browser result. External embeds, navigation and form submission are disabled here. Open freeCodeCamp to test the real behavior. Drag the lower-right corner to make this preview taller.
Terms to know
- width: Width
- Sets a requested display width. HTML dimensions and the SVG coordinate system serve different purposes.
- height: Height
- Sets a requested display height. Media keeps its own content inside this area.
If your check does not pass
- Your
iframeelement should have awidthattribute set to560. - Your
iframeelement should have aheightattribute set to315.
Use the preview to inspect the structure, then run the checks on freeCodeCamp. Watching here does not submit code or mark an official step complete.
Know where to find it
You do not have to memorize every element or CSS property. Keep useful references nearby:
- W3Schools: attributes (opens in a new tab)
Compare the syntax and a focused example.
- MDN: HTML element reference (opens in a new tab)
Look up the definition, syntax and supported behavior.
What you have accomplished
The change for “Set the frame dimensions” is ready to try. Return to freeCodeCamp, compare your result with the requirements, and run its checks. Your official progress stays there.
Independent guidance from The Code Zone, not affiliated with or endorsed by freeCodeCamp. Complete official work and certification requirements on freeCodeCamp. Curriculum checked November 15, 2026. Curriculum source (opens in a new tab).