CSS Margins: Definition properties and examples
CSS Margins specify the space and position of the element on the web page. There are basically 4 properties that can be used to specify the margins for the elements:
1 2 3 4 5 6 | <style> div { margin: 50px; border: 2px solid green; } </style> |
CSS margin example This div has a margin of 50px.
1 |
Run margin-top margin-bottom margin-right margin-left
1 2 3 4 5 6 7 | div { margin-top: 100px; margin-bottom: 60px; margin-left: 60px; margin-right: 30px; border: 2px solid green; } |
Run The value for the margin properties … Read more