-1

I just made a div in my css file and I use it in the body of my html.

.fixed-bg {
  height: 100%;
  left: -10px;
  background-image: url("space.png");
  min-height: 500px;
  background-attachment: fixed;
  background-position-x: center;
  background-position-y: center;
  background-repeat: no-repeat;
  background-size: cover;
  margin: 0;
  padding: 0;
  top: 0;
}

This is the div.

It results in an image that almost covers the entire screen, it just leaves a 5px~ gap in all sides and I want to make it so that there is no gap. There is no nesting and that is the only div that effects this part of the html at all I just can't figure out how to get rid of the gap. If it helps I am using flask as my framework.

1 Answer 1

1

You need to apply margin: 0 and padding: 0 to the body.

body {
  margin: 0;
  padding: 0;
}
1
  • 2
    body has no default padding, so margin: 0 will suffice. Jan 29 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.