CHOOSE ANY STEP
FREECODECAMP / HTML / STEP 41 OF 42
freeCodeCamp: Build a Cat Photo App, Step 41
Start with the doctype
Written guidance is free. Step videos are a member benefit.
Type the declaration listed in the task below as the first line. It starts with an opening angle bracket and an exclamation mark. Use the exact letters from the official step, and keep the closing angle bracket at the end. Keep the existing opening HTML tag below this new line.
ORIGINAL WALKTHROUGH · 0:57
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 “Start with the doctype” while keeping the earlier page structure.
- Explain HTML comment and the role it plays in this change.
- Compare the expected preview with your work before running the official checks.
THE TASK
What step 41 asks you to do
- Your code should begin with the declaration
<!DOCTYPE html>. You may have omitted the declaration, have a typo, or it is not the first line of code. - Your
<!DOCTYPE html>must be located at the top of the document.
Based on the official freeCodeCamp step 41 instructions (opens in a new tab).
Why this works
Let's add the document type declaration in freeCodeCamp's Cat Photo App. Look at the first line above the opening HTML tag. This declaration belongs before that element, at the beginning of the document.
What you should see in the preview
The declaration tells the browser to use standards mode for this HTML document. It is not an element that wraps your page content, and it does not need a closing tag. The head and body stay inside the HTML element.
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
- HTML comment
- A note in the source between <!-- and -->. The browser does not display its text in the page preview.
If your check does not pass
- Your code should begin with the declaration
<!DOCTYPE html>. You may have omitted the declaration, have a typo, or it is not the first line of code. - Your
<!DOCTYPE html>must be located at the top of the document.
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:
- MDN: HTML element reference (opens in a new tab)
Look up the definition, syntax and supported behavior.
What you have accomplished
The change for “Start with the doctype” 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).