0

So i'm trying to put an image at the top of my page, i want this image to cover the whole screen from left to right and be exactly at the top, but every time i do it there is an annoying white border at the left of the image, at the right and at the top. How can i remove that white border? Here is what i tried:

Html:

    <head>
        <div>
            <img class="image" src="#image">
        </div>
    </head>

CSS:

  .image {
  width: 100%;
  height: auto;
}
Terry
  • 63,248
  • 15
  • 96
  • 118
Gerard22
  • 353
  • 2
  • 7
  • 14

1 Answers1

2

Try this, And put your div in the <body>

* {
  margin: 0;
  padding: 0;
}

.image {
  width: 100%;
  height: auto;
}
<body>
  <div>
    <img class="image" src="G:\Pics\1.jpg">
  </div>
</body>
Rainbow
  • 6,772
  • 3
  • 11
  • 28