js中使用background-size等带“-”的css样式

xiaoxiao2021-02-28  89

通过 jQuery 这么写: $( '.xx' ).css({      'background' : 'url( no-repeat 50%' ,      'background-size' : 'auto 100%' }); 执行之后会让‘.xx’的样式如此呈现: .xx{      background : url (http://www.xx.com/xx.jpg)  50%  50%  /  auto  100%  no-repeat } 上面的不可以的话,下面的绝对可以: background:#f00 url(background.gif) no-repeat fixed 0 0/100px 100px;
转载请注明原文地址: https://www.6miu.com/read-56755.html

最新回复(0)