-2

Everytime I start a new react project and I specify width: 100% for any item (let's just say a navbar) it stretches horizontally and then leaves like 5 px or so worth of "margin" or spacing between it and the edge. I'll attach a picture below.

It's kind of hard to see, but if you look closely right above the top border, you can see the bottom of the bookmark bar - that amount of spacing is on the left and right sides of the nav bar as well. Any ideas? (I've tried setting margin to 0, but didn't work)

Here's the image

ksav
  • 20,015
  • 6
  • 46
  • 66

1 Answers1

3

By default, body adds a 8px margin.. use body { margin: 0px; } in your main CSS to fix this. This is not a bug, just a default behaviour

savageGoat
  • 1,389
  • 1
  • 3
  • 10