Answers for "css margin"

CSS
34

margin css

/* Apply to all four sides */
margin: 1em;
margin: -3px;

/* vertical | horizontal */
margin: 5% auto;

/* top | horizontal | bottom */
margin: 1em auto 2em; 

/* top | right | bottom | left */
margin: 2px 1em 0 auto;

/* Global values */
margin: inherit;
margin: initial;
margin: unset;
Posted by: Guest on February-01-2020
25

margin vs padding

Margin is on the outside of block elements, padding is on the inside.

Use margin to separate the block from things outside it
Use padding to move the contents away from the edges of the block.

Main differences:
- Vertical margins of adjacent items will overlap, padding will not
- Padding is included in the click region and background color/image,
but not the margin
Posted by: Guest on December-21-2020
0

css margin left

p.ex1 {
 margin-left: 30px;
 }
Posted by: Guest on March-26-2021
3

css margin

#blockOrInline-Block {margin: 0px/*top*/ 0px/*right*/ 0px/*bottom*/ 0px/*left*/;}
Posted by: Guest on March-24-2021
0

css code for margin

body {
  margin: 0px;
}
Posted by: Guest on September-08-2020
0

margin

margin: top right bottom left;
Posted by: Guest on July-17-2021

Browse Popular Code Answers by Language