gpt4 book ai didi

html - list-style-image 没有出现在与列表项相同的级别?

转载 作者:太空宇宙 更新时间:2023-11-04 02:12:54 24 4
gpt4 key购买 nike

我正在为列表项使用图像,但它没有显示在与 li 项相同的级别上。我正在添加指向 fiddle 的链接,请看一下。

 #container {
background: #e3e3e3;
margin-top: 50px;
}

#image {
margin: 20px;
width: 900px;
}

#title {
text-align: center;
font-family: Roboto;
background: -webkit-linear-gradient(#f35626, #feab3a);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

li {
line-height: 30px;
font-family: Roboto;
font-size: 25px;
list-style-image: url('https://s3.postimg.org/4qsqurmsj/ic_item_play.png');
}
<div class="grid_16">

<ul>

<li>
Mark Zuckerberg began programming at a young age--when he was 12 he created a messaging program that his father used in his dental office, allowing the receptionist to notify him of new patients without yelling across the office.
</li>
<li>Zuckerberg took a computer graduate class at the nearby Mercy College while still in high school.</li>
<li>
His parents even hired a computer tutor to work with the young Zuckerberg, but the tutor admitted that it quickly became difficult to stay ahead of his pupil, referring to him as a "prodigy."
</li>

</ul>
</div>

https://jsfiddle.net/n2o79mL7/

最佳答案

不要使用list-style-image

在更新的 fiddle 中查看我的更改 - https://jsfiddle.net/n2o79mL7/1/

我基本上已经从 ul 中删除了 padding 并将图像添加为 li 的背景,使用 background-position 和 padding 来正确对齐列表项。

希望这对 friend 有帮助。

关于html - list-style-image 没有出现在与列表项相同的级别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39434343/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com