简体   繁体   中英

Css - background-img url no-repeat center center Not working

i using bootstrap in my website but just i get one problem

-HTML

 <div class="first-background">
        ----- skip 
 </div>

 <div class="second-background">
        ----- skip
 </div>

-CSS

.first-background{
  padding-top: 100px;
  width: 100%;
  background-color: #E8ECEE;    
}

.second-background{
  background-image: url(../img/background.png);

  -- first ways
  background-repeat:no-repeat;
  background-size: cover;

  -- second ways
  background-repeat: no-repeat;
  background-position: center center;

  -- third ways 
  background-image: url(../img/background.png) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;

}

i tried anyways but cover or center center Not Working in my webSite

how to solve this problem? now i don't have any solution.

For starters, your syntax for the 2nd div is incorrect. Specifically, you spelled 'class' wrong. Usually stack overflow does not take kindly to these types of issues, so make sure the code you post is almost the EXACT code (minus raw data) into the question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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