Margin and Padding Challenge

Margin and padding can be tricky to grasp at first, but that's where this code challenge will come in handy.

If you have some sort of element that contains text inside of it, it's likely you'll want to give the contained text some breathing room so that it's more legible, and not hugging the side of the container so closely.

As you can see below, something just looks "off" with the text and its container.

Give the element some breathing room by adding a style of padding: 1rem; to the containing div.

index.html
Cheat Sheet Preview

Download The Official Chris Courses HTML5 Canvas Cheat Sheet

Essential canvas syntax at your fingertips.

Download Now

Providing the lift to launch your development career

© 2021 Chris Courses. All rights reserved.