css - 在 TreeView 中定位图像(图标)

标签 css image positioning

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

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

http://cssdeck.com/labs/sd1cnqm7

最佳答案

所有你需要的:

.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/

关于css - 在 TreeView 中定位图像(图标),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26000656/

相关文章:

jquery - slider 和菜单 z-index 问题定位

javascript - 将鼠标悬停在按钮上时显示图像

javascript - 为什么我用了ul标签,向上滑动不起作用?

jquery - 为什么 .hover() 不适用于映射图像,但 .mouseover() 可以?

c# - 我想使用 aspx 在网络上旋转图像

css - 移动 div 及其内容

html - CSS - 1. 标题不缩放 2. float 文本不在同一基线上

html - 使用显示 :table-cell 布置输入元素

css - 为什么@font-face 的字母间距不起作用?

html - 有没有一个好的开源谷歌地图风格 <canvas> 图像组件?