在treeview中定位图像(图标)

时间:2014-09-23 16:58:02

标签: css image positioning

http://i.imgur.com/fGPAXVN.png

我正在尝试将 - 和+图标放在树线右侧,但在文本“哺乳动物”和“大象”之前

http://cssdeck.com/labs/sd1cnqm7

1 个答案:

答案 0 :(得分:1)

所有你需要的:

.treeView li.collapsibleListOpen {
    background: url('http://code.stephenmorley.org/javascript/collapsible-lists/button-open.png') no-repeat 1em 0.5em;
    list-style: none;
}
.treeView li.collapsibleListClosed {
    background: url('http://code.stephenmorley.org/javascript/collapsible-lists/button-closed.png') no-repeat 1em 0.5em;
    list-style: none;
}
.treeView li {
    padding: 0px 2em;
    /* rest of the styles */
}

演示: http://jsfiddle.net/suaLyrop/