-2

It doesn't fit at all, how do I fix it

IMAGE

CSS:

.welcome {
  background-color: #9dbbf8;
  color: #1b1b1b;
  height: 760px;
  background-size: cover;
  background-position: center;
}
wrepg
  • 11
  • 1
  • Please provide a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) as for now, there is no way we can help you. – Amaury Hanser Mar 03 '21 at 13:07

2 Answers2

1

If you want that the div thing touches the edges the basic is that websites already have margin and padding. The easiest method is by removing it like this:

 * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

.welcome {
        background-color: #9dbbf8;
        color: #1b1b1b;
        height: 760px;
        background-size: cover;
        background-position: center;
     }
   
<div class="welcome"></div>

Hope you like my answer.

Kbs2021
  • 138
  • 11
-1

In most browsers, the body tag has a default margin set on it. So the solution would be to remove that margin:

body {
  margin: 0;
}

Also, it is a good practice to apply some basic styles to HTML elements to make them render in different browsers more consistently. A great tool for that would be to use Normalize.css or other CSS resets.

Mantas A.
  • 11
  • 3