html - 如何垂直偏移 CSS 中的元素符号或内容?

标签 html css

看这张图:
Bullets

有点不对劲,我想将内容上移,或者元素符号本身下移。我试过填充、边距和定位都无济于事。

最佳答案

尝试在列表项上设置 vertical-align 属性。可能的值是:

baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>

jsFiddle example

HTML

<ul>
    <li>a</li>
    <li>b</li>
    <li>c</li>
</ul>

CSS

ul {
    list-style-image: url(http://cdn1.iconfinder.com/data/icons/c9d/check.png);
}
li {
    vertical-align:top;   
}
​

关于html - 如何垂直偏移 CSS 中的元素符号或内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12305216/

相关文章:

javascript - 单击按钮后无法让 javascript 重定向到另一个 html 页面

html - 为什么顶部 div 的 margin-top 将适用于 `<body>` ?

html - ie9 css 问题与 tbody 宽度

javascript - 使二级UL具有特殊行为100%

javascript - 使用 jquery 循环和自动调整背景大小

javascript - 无法将 mousedown 事件附加到嵌入元素

javascript - 如何使用 ajax 帖子和数据表附加数据不起作用?

html - 使用 CSS 将字体大小设置为每个等宽字符正好为 x/window.width

css - 每行一个单词分隔句子

javascript - 在悬停时在动态生成的类中添加事件