![](/img/trans.png)
[英]css gradient background on <body> that stretches to 100% width and height
[英]Body background 100% of document width?
我的正文背景可以縮放頁面的整個寬度。
當前,它設置為背景大小:100%50px;
100%適用於大屏幕:背景按預期跨頁面寬度。 我也在尋找適用於較小屏幕(和手機!)的東西。
我將背景從body {}移到了HTML {}
將代碼移到html
html {
background: url(image.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.