【问题标题】:Padding bottom, text only in list底部填充,仅在列表中显示文本
【发布时间】:2014-12-27 03:05:48
【问题描述】:

我的列表 (ul) 有自定义列表项标记。我想让 li 元素中的文本更高,而不是列表项标记。这是因为我认为它看起来更好。

1 是今天的样子,2 是我想要的样子。

我的代码:

ul.list-ok {
    font-size: 16px;
    list-style-image: url('img/ok-18.png');
}

    ul.list-ok li {
        padding: 0 0 10px 0;
    }

我如何实现我想要的?

【问题讨论】:

标签: html css list


【解决方案1】:

这不是正确的方法,但可以解决问题:Jsfiddle here

ul.list-ok li:before {
    position: relative;
    top: -6px;
    right: 8px;
    content: url('https://cdn1.iconfinder.com/data/icons/nuvola2/16x16/actions/camera_test.png');
}
ul.list-ok li {
    padding: 0 0 10px 0;
    list-style-type: none;
}

【讨论】:

    猜你喜欢
    • 2021-08-21
    • 2014-04-13
    • 1970-01-01
    • 2013-02-06
    • 1970-01-01
    • 2015-12-13
    • 2017-05-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多