Boundaries and Space

Working with Margin

The CSS margin property controls the space between different HTML elements on a webpage. Use margin to bring page elements closer together or to move them further apart.

The CSS below ensures 2rems of space between elements with the class answer and surrounding page elements.

.answer {
  margin: 2rem;
Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.