-

xiyuetaCSS().background() 属性方法

css样式背景图片查找与替换
快速上手

xiyuetaCSS().background()属性方法,四种调用方式:
1、xiyuetaCSS(".nav").background(); //获得CSS样式背景图片
2、xiyuetaCSS(".nav").background("1.jpg"); //替换CSS样式背景图片
3、xiyuetaCSS(".nav").background("server=http://xiyueta.com/images/"); //设置CSS样式背景图片地址
4、xiyuetaCSS(".nav").background("dir=../images/"); //设置CSS样式背景图片目录
尝试一下>>

  • 代码
  • 效果
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script>
<script>xiyuetaCSS().parse("div{color:red}div{color : blu  e}div{color:green}.gds{background:url(  '/img/xiyueta.jpg '  );color:red}");
console.log(xiyuetaCSS("(all)").background());
</script>
/img/xiyueta.jpg