Lesson: HTML5 and CSS
Add a Negative Margin to an Element
An element's margin
controls the amount of space between an element's border
and surrounding elements.
If you set an element's margin
to a negative value, the element will grow larger.
Try to set the margin
to a negative value like the one for the red box.
Change the margin
of the green box to -15px
, so it fills the entire horizontal width of the yellow box around it.
The content on this page is licensed under Attribution-ShareAlike 4.0 International. Original authors: freeCodeCamp, the content was modified.