• in
InterCourses
CoursesBlogs
0
← CSS
○CSS Rule Demo: Style an Exhibit Card○Exercise: Write Your First CSS Rule○CSS Selectors Demo: Target Exhibit Details○Exercise: Target Exhibit Details○Apply CSS Demo: Three Sources○Exercise: Apply CSS Three Ways○Specificity Demo: Resolve a Style Conflict○Exercise: Resolve Specificity✦Module Quiz
○Color Palette Demo○Color Palette Exercise○Background Layer Demo○Background Layer Exercise○Type Rhythm Demo○Type Rhythm Exercise○Borders and Shadows Demo○Exercise: Borders and Shadows✦Module Quiz
●Box Model Demo: Seed Packet Card○Exercise: Space a Seed Packet○Display Demo: Swap Table Labels○Exercise: Arrange Swap Table Labels○Positioning Demo: Pickup Pin○Exercise: Pin the Pickup Location○Sizing and Overflow Demo○Exercise: Size a Seed-Swap Notice✦Module Quiz
○Advanced Selectors Demo: Book Cart Sign○Exercise: Target a Book Cart Sign○Pseudo-Classes Demo: Night Cart States○Exercise: Style Night Cart States○Pseudo-Elements Demo○Exercise: Add a Book-Quote Mark
○Lantern Market navigation demo○Lantern Market navigation exercise
○Community garden request card demo○Community garden request card exercise
○Flex Direction Demo○Exercise: Flex Direction○Main-Axis Spacing Demo○Exercise: Main-Axis Spacing○Cross-Axis Alignment Demo○Exercise: Cross-Axis Alignment○Wrapping and Flex Items Demo○Exercise: Wrapping and Flex Items○Flexbox Navigation Demo○Exercise: Flexbox Navigation
○Grid Tracks Demo○Exercise: Grid Tracks○Grid Gaps Demo○Exercise: Grid Gaps○Grid Placement Demo○Exercise: Grid Placement○Responsive Grid Demo○Exercise: Responsive Grid
○River radio schedule demo○River radio schedule exercise
○Field note color system demo○Field note color system exercise○Transforms Demo○Exercise: Rotate a Field Note
○Kite festival signal demo○Kite festival signal exercise
○Garden forecast demo○Harbor forecast exercise○Fluid sizing demo○Fluid weather bulletin exercise✦Module Quiz
○Seed inventory table demo○Tool checkout table exercise✦Module Quiz
○Community maker profile demo○Maker profile sheet exercise✦Module Quiz

Box Model Demo: Seed Packet Card

Box model: seed packet card

The market flyer is complete. For this module, a separate Riverside Seed Swap needs practical layout. Its packet card gets breathing room, an edge, and space from its neighbor.

Read the finished card

In style.css, the .packet rule has three layers: padding keeps the words away from the edge, border draws the edge, and margin separates the packet from the page. The box-sizing rule makes the declared width include padding and border.

Checkpoint: the preview shows a cream packet with a green outline and clear space around it.

Try it safely

Change .packet padding from 20px to 36px, preview the page, and notice that the content moves farther from the border. Restore 20px when you are done, then continue to the exercise.

Learn more

MDN’s official guide goes deeper into content, padding, borders, margins, and how sizing is calculated. Read MDN’s reference for the CSS box model when you want to go further.

Hint 1
1 / 1
HINT 1

Padding is inside the border; margin is outside it.

Loading editor…
READY
intercourses
css