After implementing a basic HTML code to add a background image to my webpage, I noticed there is still some empty space at the top of the page. I attempted to adjust the position of the background image using the following code, but it only lifted it upwards. Can someone please verify if this is the correct approach or if there may be an issue with my current CSS codes?
margin-top:-20px
CSS Code:
<style>
.bg-image {
left: 0;
right: 0;
height: 200%;
background-image: url("/bg.jpg");
background-position: 0px 0px;
position: fixed;
background-size: cover;
margin-top:-20px;
}
HTML Code :
<html>
<head> </head>
<body>
<div class="bg-image"></div>
</body>
</html>