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
  • 57,476
  • 13
  • 82
  • 106
Gerard22
  • 303
  • 2
  • 5
  • 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>
Zohini
  • 6,236
  • 3
  • 10
  • 27