Home HTML CSS JAVASCRIPT BOOTSTRAP Python Docker ML tutorial About us Privacy policy

CSS Margins


CSS Margins:-



Code Family
The CSS margin propertie are used to providing space around an the out side the elements content, outside of any defined border of the element.
The margin is used to top, right, bottom, and left,
Margin - Individual Sides in elements-:



  • Margin-top
  • Margin-right
  • Margin-bottom
  • Margin-left

  • All the Margin properties for elements-:



  • length:-margin in px, pt, cm, etc
  • % - a margin in % of the width of the element

  • Margin - Shorthand Property:-

    Shorthand Property of Margin

    Margin: 20px 30px 55px 100px;

    top Margin is 20px
    right Margin is 30px
    bottom Margin is 55px
    left Margin is 100px

    Auto Margin:-


    inherit Value:-