Solve problem "Adjust the Margin of an Element" online - Learn Python 3 - Snakify

Lesson: HTML5 and CSS

Adjust the Margin of an Element

An element's margin controls the amount of space between an element's border and surrounding elements.

Here, we can see that the green box and the red box are nested within the yellow box. Note that the red box has more margin than the green box, making it appear smaller.

When you increase the green box's margin, it will increase the distance between its border and surrounding elements.

Change the margin of the green box to match that of the red box.


The content on this page is licensed under Attribution-ShareAlike 4.0 International. Original authors: freeCodeCamp, the content was modified.