CSS Margin

margin properties are used to create space around elements, outside of any defined borders.

margin: top right bottom left;

margin: 10px 15px 20px 25px;

top – 10px

right – 15px

bottom – 20px

left – 25px

margin: top right/left bottom;

margin: 10px 20px 25px;

top – 10px

right/left – 20px

bottom – 25px

margin: top/bottom right/left ;

margin: 10px 20px;

top/bottom – 10px

right/left – 20px

margin: top/right/left/bottom;

margin: 10px;

top/bottom/right/left – 10px

<div class="row">
    <div class="col-4">
        <h4>Margin</h4>
    </div>
    <div class="col-8" id="margin_1">
        Hi my name is Folau
    </div>
</div>
 <style>
            #margin_1{
                margin: 20px;
                border: 2px solid blue;
            }
        </style>

Source code on Github

 




Subscribe To Our Newsletter
You will receive our latest post and tutorial.
Thank you for subscribing!

required
required


Leave a Reply

Your email address will not be published. Required fields are marked *