Margin and Padding Challenge

Now it's important to note: padding adds spacing the the inside of a container, while margin adds spacing to the outside.

If we wanted to separate the black and blue containers below, padding would be an unwise choice, simply because it would extend the amount of space between the text and the containers edge, rather than actually pushing the containers away from each other.

Although this looks fine from a design standpoint, we want to push the containers apart in this instance.

Add a margin-top: 2rem; style to the dark blue container so that there's a 2rem sized gap in between the two.

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.