HTML element's bottom margin in Firefox

Viewed 62

The <html> element doesn't have a bottom margin in Firefox (version 97.0.1):

html {
  margin: 1em;
  background: green;
}

body {
  margin: 0;
  height: 1200px;
  background: tan;
}

Is it a bug?

2 Answers

Here, you should add the margin in the body and remove the margin from html.

html {
  margin: 0;
  background: green;
}

body {
  margin: 1em;
  height: 1200px;
  background: tan;
}

Since the height of the body is more then screen size your margin bottom is going below view

html {
  margin: 1em;
  background: green;
}

body {
  margin: 0 0 1em 0;
  height: 1200px;
  background: tan;
}


----------

Related