更新时间:2023-10-09 10:00:10
With regards to the white border - it looks like either your <body>
or <html>
tag has a margin
or padding
setting applied. If either of those tags also has positioning, such as position: relative
- you can easily see this behavior.
The reason is that position: absolute
is always actually relative to the nearest positioned parent. For more information on that, check out this fantastic article.
If that is, in fact, the problem - you can try the following potential fix:
html, body { margin: 0; padding: 0; }
This will strip the spacing from around the page's edge, and hopefully bring your content flush with the edges of the browser.