DEV Community


Discussion on: Next.js + Styled Components The Really Simple Guide ▲ + 💅

quadsurf profile image
Chris Castro • Edited

chrome user agent stylesheet annoyingly has a default margin of 8px around my website... how/where do you add body css to override that globally? I tried using/importing { createGlobalStyle } from 'styled-components' but that didn't seem to work, probably because my implementation was all trial and error guessing

"""const GlobalStyle = createGlobalStyle
body {
margin: 0
i then wrapped the above component around my app, and all it did was make the contents of my app disappear like whiteout :-(

also, offers no explanation on how/where to inject global css

normancarcamo profile image
Norman Enmanuel

The solution to this problem is using the updated version of the pages/_document.js file.

Forem Open with the Forem app