* {
margin: 0;
padding: 0;
box-sizing:border-box;
}
.header {
min-height: 100vh;
width: 100%;
background-color: red;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>|
<link rel="stylesheet" href="style.css" >
</head>
<body>
<section class="header">
</section>
</body>
</html>
The body is causing the section element to move down a little bit so
The only solution I found was to use negative value with margin-top
I have tried
setting margin and padding zero to all the padding elements
and every other solution I could think of
2
Answers
I came back after washing my face and found out there was a typo at
There will be default margin to body by browser I am attaching the link to previously solved stack overflow link Why is there a default margin on the <body> element?