Responsive Web Design / CSS / The Box Model
Design a Rothko PaintingBuild an abstract composition one box at a time.
Watch Rob build the project, understand what each part is for, then work through the official freeCodeCamp workshop at your own pace.
2 recordings, one workshop. Switch parts here without scrolling past several players.
ORIGINAL WALKTHROUGH · 24:29
Watch with Rob.
Pause whenever you want to try a change. You can return to the lesson at any time.
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.
ORIGINAL WALKTHROUGH · 27:53
Watch with Rob.
Pause whenever you want to try a change. You can return to the lesson at any time.
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.
Follow the current freeCodeCamp instructions for exact requirements when the recording differs. Guide steps are explanations, not timestamped video chapters.
THE IDEA BEHIND THE BUILD
What this workshop teaches
This workshop uses an abstract composition to make the CSS box model visible. A frame surrounds a canvas, three color fields sit inside it and small changes to spacing and painted edges alter how the whole composition feels.
Separate layout dimensions from visual effects. Padding and borders contribute to the outer box under content-box sizing, margins separate boxes, and percentage dimensions depend on their containing block. Blur, shadows and transforms change the painted result without reserving corresponding extra layout space. Use the exercise to reason about those differences.
Read the layers of a box
Distinguish content, padding, border and external margin.
Investigate containment
Observe margin collapse and understand the effects of overflow hidden.
Separate layout and paint
Compare filters, shadows, radii and transforms with dimensions and spacing.

44 SMALL STEPS · THREE CLEAR GOALS
Your route through the workshop
These groups are a reading guide to the workshop, rather than timestamped chapters of the video.
Understand and frame the canvas
Review box-model diagrams, then establish canvas and frame dimensions.
Check your understanding: You can account for content width, padding, border and margin separately.
Explore step 1Arrange the color fields
Add three regions, inspect margin behavior and compare fixed with relative dimensions.
Check your understanding: You can identify the reference for each percentage and explain the containment change.
Explore step 15Soften and tilt the painted edges
Apply filters, matching shadows, corner radii and small rotations.
Check your understanding: You can distinguish visual paint effects from allocated layout space.
Explore step 33SEE HOW THE PARTS FIT
A page with a clear structure
This original abstract-study rule uses different dimensions, color and rotation. It illustrates the distinction between a box’s geometry and its painted appearance.
.study-field {
width: 260px;
height: 110px;
background: #337f91;
border-radius: 14px 6px;
transform: rotate(1deg);
}frameBorder and interior paddingcanvasContaining block and backgroundcolor fieldsSpacing, shape and painted edgesThree things to pay attention to
Outer size includes more than width
With content-box sizing, padding and borders add to the declared content dimensions.
Overflow hidden has two effects
It creates a block formatting context that changes margin behavior and can also clip overflowing content.
Visual effects do not allocate extra room
A shadow or rotated edge may extend beyond the element without pushing adjacent layout boxes away.
UNDERSTAND IT HERE · PRACTICE IT THERE
Explore each step
Choose a step for a plain-English explanation, a separate code example and resources to explore. When you are ready, its button opens the official freeCodeCamp step. Your official tests and completion stay on freeCodeCamp.
Step 1Inspect the box model diagram
UNDERSTAND THE IDEA
The opening diagram introduces the layers around an element. An image source identifies the visual resource. Inspect what the image actually shows rather than treating a filename as an explanation of the underlying concept.
What you will do
Add the specified first diagram image and identify its content, padding, border and margin.
<img src="box-study.png" alt="A diagram showing the content, padding and border of a box">What to notice: The filename is illustrative and needs a real file to load. A diagram helps explain the model; it is not the completed painting.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 2Locate the content area
UNDERSTAND THE IDEA
The next diagram isolates where content occupies space. An image source identifies the visual resource. Inspect what the image actually shows rather than treating a filename as an explanation of the underlying concept.
What you will do
Update the image source as requested and identify the content box.
<img src="box-study.png" alt="A diagram showing the content, padding and border of a box">What to notice: The filename is illustrative and needs a real file to load. A diagram helps explain the model; it is not the completed painting.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 3Distinguish padding and border
UNDERSTAND THE IDEA
Interior space and a visible boundary are different layers. An image source identifies the visual resource. Inspect what the image actually shows rather than treating a filename as an explanation of the underlying concept.
What you will do
Switch to the requested diagram and compare padding with the border.
<img src="box-study.png" alt="A diagram showing the content, padding and border of a box">What to notice: The filename is illustrative and needs a real file to load. A diagram helps explain the model; it is not the completed painting.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 4Recall the external margin
UNDERSTAND THE IDEA
Margin separates an element from its surroundings. Removing an earlier declaration can reveal an inherited value, another matching rule or a browser default. CSS changes need to be understood in the surrounding cascade.
What you will do
Remove the temporary diagram image after reviewing the external margin layer.
.swatch {
width: 180px;
/* Color now comes from a variant rule. */
}What to notice: This snippet retains the geometry while leaving color to another rule. Do not remove unrelated declarations when the task asks for one property.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 5Create the painting canvas
UNDERSTAND THE IDEA
An empty container becomes a visible shape once it has geometry and color. A container groups elements for presentation. A shared class can apply common geometry while another class identifies an individual visual variant.
What you will do
Add the requested canvas div.
<div class="swatch-board">
<div class="swatch warm"></div>
</div>What to notice: This is a small swatch example with different classes. The container and child are separate boxes with different responsibilities.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 6Connect the painting stylesheet
UNDERSTAND THE IDEA
The visual rules must be loaded by the document. A stylesheet link connects a CSS file to the document. A correct rule in an unlinked file will not affect the page.
What you will do
Add the requested stylesheet link in the head.
<link rel="stylesheet" href="swatches.css">What to notice: Use the actual filename supplied by the workshop. The example file and its rules belong to a different visual study.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 7Set the canvas width
UNDERSTAND THE IDEA
Start with one dimension of the canvas content box. An empty block normally has no content height. Explicit dimensions can make an otherwise invisible colored box visible.
What you will do
Set the requested canvas width.
.swatch { width: 180px; height: 30px; }What to notice: These dimensions differ from the marker and painting tasks. The visible outer size can also include borders and padding.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 8Set the canvas height
UNDERSTAND THE IDEA
An empty div needs a height to show a rectangular surface. A height declaration controls the content box unless another box-sizing rule changes that relationship. Consider the containing box when using percentages.
What you will do
Add the requested canvas height.
.study-area { height: 360px; }What to notice: This separate study area has a different height. The right value depends on the box you are actually styling, not a memorized project answer.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 9Color the canvas surface
UNDERSTAND THE IDEA
The surface will sit behind all three inner color fields. A named CSS color is a predefined value. It is convenient for a simple experiment, but its name does not imply maximum intensity in a particular RGB channel.
What you will do
Set the requested canvas background color.
.warm { background-color: coral; }What to notice: This example uses a different class and color. A color declaration still needs a visible box to show its effect.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 10Wrap the canvas in a frame
UNDERSTAND THE IDEA
A wrapper separates the frame’s border from the canvas itself. A container groups elements for presentation. A shared class can apply common geometry while another class identifies an individual visual variant.
What you will do
Place the canvas inside the requested frame div.
<div class="swatch-board">
<div class="swatch warm"></div>
</div>What to notice: This is a small swatch example with different classes. The container and child are separate boxes with different responsibilities.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 11Draw the frame boundary
UNDERSTAND THE IDEA
A thick border adds to the outer dimensions under content-box sizing. A visible border needs an appropriate width and style. Its default color is normally currentColor, so setting color explicitly makes the intention clearer.
What you will do
Add the requested solid frame border.
.overlay { border-left: 6px solid #173c59; }What to notice: The width, style and color here are illustrative. A border adds to a content-box element’s outer dimensions.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 12Set the frame’s content width
UNDERSTAND THE IDEA
The frame’s width describes the area inside its padding and border. An empty block normally has no content height. Explicit dimensions can make an otherwise invisible colored box visible.
What you will do
Set the requested frame width and compare it with the canvas width.
.swatch { width: 180px; height: 30px; }What to notice: These dimensions differ from the marker and painting tasks. The visible outer size can also include borders and padding.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 13Add space inside the frame
UNDERSTAND THE IDEA
Padding separates the canvas from the frame’s border. Padding creates space inside a box’s border. With content-box sizing it adds to the declared content width and height.
What you will do
Apply the requested frame padding.
.swatch-board { padding: 16px 8px; }What to notice: These different values show interior space. Compare padding with external margins and include it when reasoning about the outer dimensions.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 14Position the framed composition
UNDERSTAND THE IDEA
External space is independent of the frame’s interior padding. Margins separate a box from its neighbors. Automatic horizontal margins can center a constrained block when spare space is available.
What you will do
Apply the requested frame margins and inspect its centered position.
.swatch { margin: 14px auto; }What to notice: The two-value shorthand sets vertical and horizontal margins. It does not mean all four sides receive the first value.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 15Add the first color field
UNDERSTAND THE IDEA
The first inner box will have its own size and surface. A container groups elements for presentation. A shared class can apply common geometry while another class identifies an individual visual variant.
What you will do
Create the requested first div inside the canvas.
<div class="swatch-board">
<div class="swatch warm"></div>
</div>What to notice: This is a small swatch example with different classes. The container and child are separate boxes with different responsibilities.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 16Size the first field horizontally
UNDERSTAND THE IDEA
Its width is narrower than the canvas. An empty block normally has no content height. Explicit dimensions can make an otherwise invisible colored box visible.
What you will do
Set the requested first field width.
.swatch { width: 180px; height: 30px; }What to notice: These dimensions differ from the marker and painting tasks. The visible outer size can also include borders and padding.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 17Size the first field vertically
UNDERSTAND THE IDEA
A height makes the empty color field visible. A height declaration controls the content box unless another box-sizing rule changes that relationship. Consider the containing box when using percentages.
What you will do
Add its requested height.
.study-area { height: 360px; }What to notice: This separate study area has a different height. The right value depends on the box you are actually styling, not a memorized project answer.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 18Choose the first field’s color
UNDERSTAND THE IDEA
The first region should contrast with the canvas behind it. A named CSS color is a predefined value. It is convenient for a simple experiment, but its name does not imply maximum intensity in a particular RGB channel.
What you will do
Apply its requested background color.
.warm { background-color: coral; }What to notice: This example uses a different class and color. A color declaration still needs a visible box to show its effect.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 19Space and center the first field
UNDERSTAND THE IDEA
The top margin introduces vertical separation as well as horizontal centering. Margins separate a box from its neighbors. Automatic horizontal margins can center a constrained block when spare space is available.
What you will do
Apply the requested first field margins and observe where the canvas begins.
.swatch { margin: 14px auto; }What to notice: The two-value shorthand sets vertical and horizontal margins. It does not mean all four sides receive the first value.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 20Investigate a collapsing margin
UNDERSTAND THE IDEA
A first child’s top margin can collapse with its parent under certain conditions. Padding creates space inside a box’s border. With content-box sizing it adds to the declared content width and height.
What you will do
Add the requested temporary canvas padding and observe the boundary change.
.swatch-board { padding: 16px 8px; }What to notice: These different values show interior space. Compare padding with external margins and include it when reasoning about the outer dimensions.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 21Create a new block formatting context
UNDERSTAND THE IDEA
Overflow hidden can contain child margins while also clipping overflow. Overflow controls content that extends beyond a box. Hidden clips overflow and creates a block formatting context, which can also affect margin-collapsing behavior.
What you will do
Replace the temporary padding with the requested overflow rule; compare the canvas dimensions and child placement.
.paint-area { overflow: hidden; }What to notice: This rule can change both clipping and layout interactions. Do not use hidden to conceal a layout error without understanding what is being clipped.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 22Add the second color field
UNDERSTAND THE IDEA
The second region is a sibling of the first. A container groups elements for presentation. A shared class can apply common geometry while another class identifies an individual visual variant.
What you will do
Add the requested second div inside the canvas.
<div class="swatch-board">
<div class="swatch warm"></div>
</div>What to notice: This is a small swatch example with different classes. The container and child are separate boxes with different responsibilities.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 23Set the second field’s width
UNDERSTAND THE IDEA
The composition uses different widths for its color fields. An empty block normally has no content height. Explicit dimensions can make an otherwise invisible colored box visible.
What you will do
Apply the requested second field width.
.swatch { width: 180px; height: 30px; }What to notice: These dimensions differ from the marker and painting tasks. The visible outer size can also include borders and padding.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 24Set the second field’s height
UNDERSTAND THE IDEA
Independent heights change the visual balance. A height declaration controls the content box unless another box-sizing rule changes that relationship. Consider the containing box when using percentages.
What you will do
Apply the requested second field height.
.study-area { height: 360px; }What to notice: This separate study area has a different height. The right value depends on the box you are actually styling, not a memorized project answer.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 25Color the second field
UNDERSTAND THE IDEA
Each field has its own surface rather than inheriting one shared background. A named CSS color is a predefined value. It is convenient for a simple experiment, but its name does not imply maximum intensity in a particular RGB channel.
What you will do
Set the requested second background color.
.warm { background-color: coral; }What to notice: This example uses a different class and color. A color declaration still needs a visible box to show its effect.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 26Center the second field
UNDERSTAND THE IDEA
Automatic side margins distribute the remaining horizontal space. Margins separate a box from its neighbors. Automatic horizontal margins can center a constrained block when spare space is available.
What you will do
Add the requested second field margins.
.swatch { margin: 14px auto; }What to notice: The two-value shorthand sets vertical and horizontal margins. It does not mean all four sides receive the first value.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 27Add the third color field
UNDERSTAND THE IDEA
The final field completes the three-region composition. A container groups elements for presentation. A shared class can apply common geometry while another class identifies an individual visual variant.
What you will do
Create the requested third div inside the canvas.
<div class="swatch-board">
<div class="swatch warm"></div>
</div>What to notice: This is a small swatch example with different classes. The container and child are separate boxes with different responsibilities.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 28Use a parent-relative width
UNDERSTAND THE IDEA
A percentage width refers to the containing block’s available width. An empty block normally has no content height. Explicit dimensions can make an otherwise invisible colored box visible.
What you will do
Apply the requested percentage width to the third field.
.swatch { width: 180px; height: 30px; }What to notice: These dimensions differ from the marker and painting tasks. The visible outer size can also include borders and padding.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 29Use a parent-relative height
UNDERSTAND THE IDEA
A percentage height relies on a definite height in the containing block. A height declaration controls the content box unless another box-sizing rule changes that relationship. Consider the containing box when using percentages.
What you will do
Set the requested percentage height and relate it to the canvas height.
.study-area { height: 360px; }What to notice: This separate study area has a different height. The right value depends on the box you are actually styling, not a memorized project answer.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 30Color the third field
UNDERSTAND THE IDEA
The third surface should be read in the context of its neighbors. A named CSS color is a predefined value. It is convenient for a simple experiment, but its name does not imply maximum intensity in a particular RGB channel.
What you will do
Apply the requested third background color.
.warm { background-color: coral; }What to notice: This example uses a different class and color. A color declaration still needs a visible box to show its effect.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 31Center the third field
UNDERSTAND THE IDEA
A percentage-width box can still have automatic side margins. Margins separate a box from its neighbors. Automatic horizontal margins can center a constrained block when spare space is available.
What you will do
Add the requested third field margins.
.swatch { margin: 14px auto; }What to notice: The two-value shorthand sets vertical and horizontal margins. It does not mean all four sides receive the first value.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 32Make room between the later fields
UNDERSTAND THE IDEA
The second field’s bottom margin provides deliberate separation. Margins separate a box from its neighbors. Automatic horizontal margins can center a constrained block when spare space is available.
What you will do
Update its margin shorthand to include the requested bottom space.
.swatch { margin: 14px auto; }What to notice: The two-value shorthand sets vertical and horizontal margins. It does not mean all four sides receive the first value.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 33Soften the canvas as a whole
UNDERSTAND THE IDEA
A filter affects the rendered element and its descendants. A blur filter softens the rendered element and its contents. A blurred edge and a box shadow are different effects, even when both suggest softness.
What you will do
Apply the requested canvas blur and inspect the entire composition.
.paint-area { filter: blur(1.5px); }What to notice: This separate blur value is illustrative. Filters affect the rendered content; they do not change the underlying document structure.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 34Soften the first two fields further
UNDERSTAND THE IDEA
A child filter can add its own effect inside the filtered parent. A blur filter softens the rendered element and its contents. A blurred edge and a box shadow are different effects, even when both suggest softness.
What you will do
Add the requested shared blur rule for the first and second fields.
.paint-area { filter: blur(1.5px); }What to notice: This separate blur value is illustrative. Filters affect the rendered content; they do not change the underlying document structure.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 35Give the third field its own softness
UNDERSTAND THE IDEA
The third field can use a different blur amount. A blur filter softens the rendered element and its contents. A blurred edge and a box shadow are different effects, even when both suggest softness.
What you will do
Add its requested filter and compare the visible edges.
.paint-area { filter: blur(1.5px); }What to notice: This separate blur value is illustrative. Filters affect the rendered content; they do not change the underlying document structure.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 36Extend the first field’s color softly
UNDERSTAND THE IDEA
A shadow can extend painted color without reserving additional layout space. Box-shadow paints an effect around a box. Offsets move it, blur softens it and spread changes its reach; the painted shadow does not reserve normal layout space.
What you will do
Add the requested first field shadow, including blur and spread.
.sample { box-shadow: 4px 6px 10px 2px rgb(20 70 90 / 35%); }What to notice: These values are different from the project. Read the lengths in order and inspect the effect before adjusting several values at once.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 37Match the second field’s shadow
UNDERSTAND THE IDEA
Matching the shadow color to the field softens its boundary. Box-shadow paints an effect around a box. Offsets move it, blur softens it and spread changes its reach; the painted shadow does not reserve normal layout space.
What you will do
Set the requested second field shadow.
.sample { box-shadow: 4px 6px 10px 2px rgb(20 70 90 / 35%); }What to notice: These values are different from the project. Read the lengths in order and inspect the effect before adjusting several values at once.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 38Match the third field’s shadow
UNDERSTAND THE IDEA
The last field has its own shadow geometry. Box-shadow paints an effect around a box. Offsets move it, blur softens it and spread changes its reach; the painted shadow does not reserve normal layout space.
What you will do
Add the requested third field shadow and inspect the boundary.
.sample { box-shadow: 4px 6px 10px 2px rgb(20 70 90 / 35%); }What to notice: These values are different from the project. Read the lengths in order and inspect the effect before adjusting several values at once.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 39Round the first field’s corners
UNDERSTAND THE IDEA
A radius changes the shape of the painted corners. Border-radius rounds the corners of a box. Its shorthand can set one radius or assign different radii in a defined corner order.
What you will do
Apply the requested single radius to the first field.
.paint-block { border-radius: 12px 18px 10px 24px; }What to notice: The four values map to top-left, top-right, bottom-right and bottom-left. These sample values differ from the painting task.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 40Use two corner-radius values
UNDERSTAND THE IDEA
Two values apply to opposite pairs of corners. Border-radius rounds the corners of a box. Its shorthand can set one radius or assign different radii in a defined corner order.
What you will do
Set the requested pair of radii on the second field.
.paint-block { border-radius: 12px 18px 10px 24px; }What to notice: The four values map to top-left, top-right, bottom-right and bottom-left. These sample values differ from the painting task.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 41Control four corners independently
UNDERSTAND THE IDEA
Four radius values proceed clockwise from the top-left corner. Border-radius rounds the corners of a box. Its shorthand can set one radius or assign different radii in a defined corner order.
What you will do
Apply the requested four-value radius to the third field.
.paint-block { border-radius: 12px 18px 10px 24px; }What to notice: The four values map to top-left, top-right, bottom-right and bottom-left. These sample values differ from the painting task.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 42Tilt the first field slightly
UNDERSTAND THE IDEA
A transform changes visual presentation without recalculating its allocated layout box. A rotation changes the rendered orientation around the transform origin. It does not reserve a rotated outline in the normal document flow.
What you will do
Apply the requested small negative rotation to the first field.
.paint-block { transform: rotate(-1deg); }What to notice: A negative angle rotates in the opposite direction to a positive one in the usual writing context. Inspect edges and overlaps after transforming.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 43Tilt the second field in the other direction
UNDERSTAND THE IDEA
The sign changes the direction of rotation. A rotation changes the rendered orientation around the transform origin. It does not reserve a rotated outline in the normal document flow.
What you will do
Add the requested positive rotation to the second field.
.paint-block { transform: rotate(-1deg); }What to notice: A negative angle rotates in the opposite direction to a positive one in the usual writing context. Inspect edges and overlaps after transforming.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
Step 44Finish the third field’s tilt
UNDERSTAND THE IDEA
Small variations give the three fields different visual edges. A rotation changes the rendered orientation around the transform origin. It does not reserve a rotated outline in the normal document flow.
What you will do
Apply the requested third rotation, then inspect the complete composition and run the official checks.
.paint-block { transform: rotate(-1deg); }What to notice: A negative angle rotates in the opposite direction to a positive one in the usual writing context. Inspect edges and overlaps after transforming.
Resources to explore
Read another explanation or experiment with examples before trying the official step.
Ready to try it? Use freeCodeCamp’s exact requirements and run its checks there. The example above is for understanding the concept.
READY TO BUILD?
Keep the instructions beside the video.
Start the official workshop in a new tab, play the walkthrough here, and pause to make each change yourself. Run freeCodeCamp’s checks before moving on. Write and check your project in the official freeCodeCamp editor.
An independent walkthrough by The Code Zone. Not affiliated with or endorsed by freeCodeCamp. The project and official tests belong to freeCodeCamp; the explanations and visual guide on this page are our companion material.