设置css元素的背景图像 [英] set background image of a css element

查看:117
本文介绍了设置css元素的背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下来设置css元素的文本内容

i use the following to to set the text content of an css element

var cell = document.createElement('li');
        cell.textContent = this.labelForIndex(index);

现在我想设置背景图像和颜色..... how to do it ?

Now i want to set the back-ground image and color.....how to do it??

推荐答案

$(cell).css("background-image","url('mybg.png)");

这篇关于设置css元素的背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆