Leilin Peng Share: CSS margin (Margin)

  CSS margin (margins) of space around the property definition elements.

  margin

  Clear margin (outer frame) around the element area. margin no background color is completely transparent.

  margin can be changed on individual elements, bottom, left and right margins, you can change all the properties again.

  Possible values

  Value Description

  auto set your browser margins.

  The result of this will depend on the browser

  length defines a fixed margin (using pixel, pt, em, etc.)

  % Using a defined percentage margin

Remark

Margin can use negative values, the overlapping content.

  Margin - Margin property unilateral

  In CSS, it can specify different different side margins:

  Examples

  margin-top:100px; margin-bottom:100px; margin-right:50px; margin-left:50px;

  Margin - shorthand property

  To shorten the code, it is possible to use all the margin properties margin specified in a property. This is called a shorthand property.

  Shorthand property for all the margin properties is margin:

  Examples

  margin:100px 50px;

  margin property can have one to four values. / P>

  margin:25px 50px 75px 100px;

  The margin is 25px

  Right margin to 50px

  The bottom margin is 75px

  100px left margin

  margin:25px 50px 75px;

  The margin is 25px

  Left and right margins to 50px

  The bottom margin is 75px

  margin:25px 50px;

  Top and bottom margins to 25px

  Left and right margins to 50px

  margin:25px;

  All four margins are 25px

  All CSS margin properties

  Attribute Description

  margin shorthand property. Set all margins attributes in a statement.

  margin-bottom is provided at the outside of an element.

  margin-left set left outside an element.

  margin-right is provided outside the right of an element.

  Margin-top disposed on the outside of an element.

  (Editor: Leilin Peng Source: network intrusion deleted)

Guess you like

Origin www.cnblogs.com/pengpeng1208/p/11232362.html