CSS margin-left Property


The margin-left property in CSS is used to set the width of the margin on the left of the desired element. Negative values of this property are allowed.

The margin-left property sets the left margin of an element.

  • A positive value is used when it is desired that the margin is farther away from its neighbors.
  • A negative value is used when it is desired that the margin is placed closer.

CSS Syntax

margin-left: length|auto|initial|inherit;

Supported Browsers:

  • Firefox: 52.0, 2.0 -moz-
  • Google Chrome: 50.0, 4.0 -webkit-
  • Internet Explorer: 10.0
  • Safari: 9.0, 3.1 -webkit-
  • Opera: 37.0, 15.0 -webkit-, 11.1

Example -