Next.js Discord

Discord Forum

Browser Border - Removal

Answered
Villanuco de Las Encartaciones posted this in #help-forum
Open in Discord
Villanuco de Las EncartacionesOP
So I'm having issues with a border on my browser, it works fine on the default 'localhost:3000/', but when I go to a different route there ends up being a white border which I can't seem to get rid of.
Answered by Villanuco de Las Encartaciones
fixed it ty!, for some reasosn important didnt work, so I just found out I could do npm normalize and that worked.
View full answer

10 Replies

Villanuco de Las EncartacionesOP
theres both my relevant files.
Blanc de Hotot
Just add margin: 0; to your root element
I do this on the <body> of my RootLayout component
Villanuco de Las EncartacionesOP
i have that in global.css @Blanc de Hotot
Blanc de Hotot
If you go to one of the pages with the border and inspect the CSS on <body> does it confirm that it has the margin: 0; attribute?
Villanuco de Las EncartacionesOP
yep found it, says 8px
how would i modify that then ?
Blanc de Hotot
In the inspector tool you should be able to see where the 8px margin is being inherited from and track back. Alternatively, you could probably get by with putting !important after the margin: 0 attribute in your global.css file. This way is a little hacky and the !important attribute is generally considered bad practice but it's a quick fix for the short-term
Villanuco de Las EncartacionesOP
fixed it ty!, for some reasosn important didnt work, so I just found out I could do npm normalize and that worked.
Answer
Blanc de Hotot
Nice! Glad you got it fixed. You should mark your last post as the answer for this post so others can see it's been solved if they're searching for a similar problem