freeCodeCamp Challenge Guide: Add a Negative Margin to an Element

Add a Negative Margin to an Element


Problem Explanation

Margin is the spacing between the border of an element and other elements on the page.

•There is spacing from the top, right, bottom, and left.

•The number is in css units

For example, to adjust the margin of an element to be negative you could use:

.example {
margin: -10px;
}

To adjust the padding of an individual element use:
padding: -10px;

You can find out much more about negative margins here

Good luck!

2 Likes

.I changed it 20 px but still not working
green-box {
background-color: green;
padding: 20px;
margin: -15px;