Answers for "margin body css"

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
0

why there's a default margin in html <body>

body {
  margin: 0px;
  padding: 0px;
  ...
}
Posted by: Guest on August-16-2020
0

css my body have margin top

You probably have an element with margin-top as one of the first children of body.

Read up on collapsing margins.

Purely as a simple test, set padding: 1px on body. If the gap goes away, I'm right.

/* 
from stackoverflow.com ->
css & html5: why does my body have a spacing at the top

 */
Posted by: Guest on March-06-2021

Browse Popular Code Answers by Language