CSS Margins

CSS Margins

You can generate space around elements with CSS margin.

You can apply margin to an element from all sides (top, bottom, right, left).

When you apply margin then you can see space (white background) around html elements.

Margin – All Sides

For CSS margin you can use these css properties.

  • margin-top
  • margin-bottom
  • margin-right
  • margin-left

You can apply these following values with css margin

  • px
  • pt
  • pc
  • in
  • cm
  • mm
  • %
  • em
  • rem
  • ex
  • ch
  • vw
  • vh
  • vmin
  • vmax

CSS Margin Example

p {
margin-top: 100px;
margin-left: 200px;
margin-right: auto;
margin-bottom: 100px;
}

By | 2017-11-01T20:38:49+00:00 August 4th, 2016|CSS|Comments Off on CSS Margins

About the Author:

mm
I have professional 10 years experience in Web Development, Web Designing, Graphics Designing, Video Editing & Composition, Search Engine Optimization, Mobile Application Development, Social Media Marketing and Digital Media Marketing.