I have a Next.JS application in which I have a div. I want this div to start at the very top of the page. I have padding and margin for the body, HTML and the div itself set to 0 and yet, it's moved a bit down. I checked every single component, none have padding or margin on them. I don't know what is causing it.
This is the code in my return statement
<div>
<Head>
<title>{book.title}</title>
<meta name="description" content={book.description} />
<link rel="icon" href="/favicon.ico" />
</Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Nunito&family=Tinos&display=swap" rel="stylesheet" />
<div className="wall">
<div className="wallContent">
<h1>{book.title}</h1>
</div>
</div>
</div>
)
This is CSS in global
html {
overflow-x: hidden;
}
html,
body {
padding: 0;
margin: 0;
font-family: 'Nunito', sans-serif;
background-color: #217934;
}
* {
box-sizing: border-box;
}
.wall {
width: 100vw;
height: 60vh;
background-color: #FFF0D9;
}
.wallContent {
position: relative;
top: 50%;
color: #FF5C5C;
transform: translate(0%, -50%);
text-align: center;
}```
Any help on why it's moved is appreciated!