thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

HTML / FREECODECAMP WORKSHOP COMPANION

freeCodeCamp: Build a Heart Icon

Draw a small heart with inline SVG. Learn how the SVG container, a path, dimensions and fill work together to describe a scalable shape.

Cartoon Rob demonstrates the structure and result of Build a Heart Icon.
Conceptual illustration. The workshop itself uses plain HTML and native browser styling.

Which step do you need help with?

Choose any step. You can move freely without completing earlier steps here.

Written guidance is available to everyone. Step videos require a signed-in Code Zone account with video access.

See the topic for each step
  1. Step 1: Create the SVG container
  2. Step 2: Nest the path element
  3. Step 3: Give the path its heart shape
  4. Step 4: Set the icon dimensions
  5. Step 5: Define the view box
  6. Step 6: Fill the heart red

What you will build

Draw a small heart with inline SVG. Learn how the SVG container, a path, dimensions and fill work together to describe a scalable shape.

Follow 6 small changes, from the supplied starter to the finished HTML structure. This workshop focuses on HTML; native browser styling may look plain.

What you will learn

  • svg: SVG container
  • body: Document body
  • path: SVG path
  • d: Path data
  • width: Width
  • height: Height
  • viewBox: SVG coordinate system
  • fill: Fill color

How to use this companion

  • Build on freeCodeCamp. Keep its workshop open in another tab. Your code, checks and course progress stay there.
  • Come here when you need context. Open the matching step for the task, reasoning, definitions and expected preview.
  • Watch a focused explanation. Member videos show how the instructions become code and what changes in the preview.
  • Try it yourself. Return to freeCodeCamp and run its checks before moving on.

Skills you can use beyond this workshop

Practice translating requirements into small changes, nesting elements in the right place, reading the browser result and checking reliable references. These habits help you understand unfamiliar code without memorizing every element or property.

Ready to work through the workshop?

Choose a step above whenever you need guidance, or start coding in the official workshop.

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).