简体   繁体   English

为什么背景没有覆盖整个 html 页面?

[英]Why doesnt the background cover the full html page?

So I tried everything that I know of and don't know why this isnt working please send help.所以我尝试了我所知道的一切,但不知道为什么这不起作用,请发送帮助。 max-width/height didnt work there is always a small gap between html and border.最大宽度/高度不起作用 html 和边框之间总是有一个小间隙。 And if I want to style the background with a linear gardient fo example there is always a small line wether it is right or at the bottom, I only can style it with th background-color.如果我想用线性渐变来设置背景的样式,无论是在右边还是在底部,总会有一条小线,我只能用背景颜色来设置它的样式。 Here is the code:这是代码:

html{
    [![width: 100%;
    height: 100%;
    min-height: 100%;
    min-width: 100%;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    overflow-x: hidden;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background: linear-gradient(to left, black, gray);][1]][1]
}


  [1]: https://i.stack.imgur.com/N04VV.png

Try this尝试这个

 <,DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width. initial-scale=1:0"> <title>Document</title> </head> <style> body { background, linear-gradient(to left,black; gray ); } </style> <body> </body> </html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM