Utilize the left, right, top, and bottom properties instead of margin for enhanced styling.
Observe the adjustments made:
<!DOCTYPE html>
<head>
<style type="text/css">
html {
height: 100%;
background-color: #272C34;
margin: 0%;
padding: 0%;
}
body{
height: 100%;
position: static;
margin: 0%;
padding: 0%;
}
#whitetop {
width: 100%;
height: 4%;
position: absolute;
background-color: #E8E8E7;
top: 10%;
left: 0%;
right: 0%;
bottom: -10%;
padding: 0%;
z-index: 1;
}
#whitebot {
width: 100%;
height: 30%;
position: absolute;
background-color: #E8E8E7;
top: 32%;
left: 0%;
right: 0%;
bottom: -32%;
padding: 0%;
z-index: 1;
}
#earth {
width: 100%;
height: 20%;
position: absolute;
top: 10%;
left: 0%;
right: 0%;
bottom: -10%;
z-index: 0;
}
</style>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Home</title>
</head>
<body>
<div id="whitetop">
</div>
<div id="whitebot">
</div>
<img src="earth2.jpg"/ id="earth">
</body>
</html>