Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法将我的 li 标签上的图像变小,比如 35x35px。
<ul> <li id="grund_brand"></li> </ul>
我的 CSS
#grund_brand { list-style-image: url('/indhold/uddannelse/grund_brand.jpg'); }
问题是:图片很棒,但希望将其缩小到 35x35 像素。
我真的不记得这样做需要什么。
最好的解决方案是使用已经是您需要的大小的图像。但如果你不能这样做,请尝试将图像放入 li 中,如下所示:
<ul> <li id="grund_brand"><img src="/indhold/uddannelse/grund_brand.jpg" /></li> </ul>
然后使用 CSS 设置该图像的高度和宽度:
li img { height: 35px; width: 35px; }