Chrome扩展程序的自定义复选框css

时间:2015-04-08 01:22:23

标签: css google-chrome-extension

我真的想为我的Chrome扩展程序中的复选框使用自定义复选框设计,但它似乎不起作用。我的猜测是对复选框的背景图像存在某种干扰,因为除了背景之外似乎都应用了所有的css。

我用于复选框的css代码来自iCheck:

.icheckbox_flat-blue,
.iradio_flat-blue {
    display: inline-block;
    *display: inline;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    width: 20px;
    height: 20px;
    background: url(blue.png) no-repeat;
    border: none;
    cursor: pointer;
}

.icheckbox_flat-blue {
    background-position: 0 0;
}
    .icheckbox_flat-blue.checked {
        background-position: -22px 0;
    }
    .icheckbox_flat-blue.disabled {
        background-position: -44px 0;
        cursor: default;
    }
    .icheckbox_flat-blue.checked.disabled {
        background-position: -66px 0;
    }

.iradio_flat-blue {
    background-position: -88px 0;
}
    .iradio_flat-blue.checked {
        background-position: -110px 0;
    }
    .iradio_flat-blue.disabled {
        background-position: -132px 0;
        cursor: default;
    }
    .iradio_flat-blue.checked.disabled {
        background-position: -154px 0;
    }

blue.png看起来像这样:

enter image description here

在常规网站上,这个html和css工作正常,但一旦转移到chrome扩展名,它就没有。有什么我做错了吗?如何获得自定义复选框设计?

2 个答案:

答案 0 :(得分:-1)

background-image必须在引号中:

background: url("blue.png") no-repeat;

答案 1 :(得分:-2)

抱歉,我已经回答了我自己的问题。我仍然没有真正知道问题是什么,但我转而使用iCheck,并决定创建自己的代码来编辑复选框。

抱歉浪费任何时间。