CSS margin

Previous Next

Demo of the different values of the margin property.

Click the property values below to see the result:

margin: 0;
margin: 10px;
margin: 25px;
margin: 100px;
margin: auto;
margin: 10%;
margin: 20%;
margin: 10px 1px 15px 50px;
margin: 10px 1px;
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.
See this blue div element with different margin values.

Play more with the code in our Tryit yourself editor: Try it Yourself ❯