在jq中,为div添加背景图片的css样式

$(".my_1").css("background-image","url(img/my/bg_1.jpg)").css("background-position","center center").css(" background-repeat","no-repeat");

上面红色字体不能给图片路径添加../,添加了背景图片不会显示,亲身测试过了,css样式中有../,但是好像在jq中不支持~

猜你喜欢

转载自blog.csdn.net/qq_38337245/article/details/85029755