Margins are space around your element
At the bottom of this page there is a code editor pre-loaded with the lesson's code.
.withMargins {
margin-top: 50px;
margin-bottom: 75px;
margin-right: 100px;
margin-left: 125px;
}
➼ withMargins
- This is our CSS class name.
➼ margin-top
- Above our element, there will be 50px of space.
➼ margin-bottom
- Below our element, there will be 75 px of space.
➼ margin-right
- To the right of our element, there will be 100 px of space.
➼ margin-left
- To the left of our element, there will be 125 px pf space.
<div class = 'withMargins'>
On this glorious day we will learn about margins.
I love margins! How about you?
</div>