Width 100% with white borders around it. WHy?

后端 未结 2 424
傲寒
傲寒 2020-11-30 13:12

Ok, I\'m trying to design a website that has an image at the top that spans the full width of the browser. And below that I want to put different colored div containers that

2条回答
  •  青春惊慌失措
    2020-11-30 14:15

    The body element has some margins by default. Unless you remove them, any element that you put inside, no matter it's width (unless it's in position absolute I think) will have some borders. They aren't borders, but the gab in between the end of your element and the side of the body. Try this :

    body{
        margin: 0;
    }
    

    If that doesn't work, then please show us an example of your code on JSBin, Codepen or similar (or even a live version if possible).

提交回复
热议问题