How do I set the background image size in CSS?

后端 未结 3 811
隐瞒了意图╮
隐瞒了意图╮ 2021-01-29 00:50

So I have css code as follows:

.jumbobg {
    background: url(\'http://znc.mane-frame.com/static/silverleaf.png\') fixed          


        
3条回答
  •  悲&欢浪女
    2021-01-29 01:38

    for multiple backgrounds in the way you are using (shorthand) here is the syntax:

    background: [  , ]* 
    
     =  ||  [ /  ]? ||  ||  || {1,2}
    
     =  ||  [ /  ]? ||  ||  || {1,2} || 
    

    so with that in mind here is an example how to set background-size for the 1st background:

    body {
      background: url(http://lorempixel.com/1200/900) repeat-x scroll 0 45px / auto 100%, url(http://lorempixel.com/1200/45) no-repeat scroll center 0 / 100% auto
    }

提交回复
热议问题