簡體   English   中英

如何使背景與css中的div大小相同

[英]how to make the background the same as the div size in css

我正在開發一個網站,我需要知道如何使背景與css中的div大小相同..我正在嘗試使BG尺寸自動但它不起作用>所以任何人都知道解決方案!!

謝謝

嘗試:

{  
 background: url(bgimage.jpg) no-repeat;
 background-size: 100%;
}
#header { 
      background: url(images/bg.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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM