简体   繁体   English

自定义项目符号点大小问题。 插入了一个 img 自定义项目符号点但无法调整项目符号的大小

[英]Custom bullet point sizing problem. Inserted a img custom bullet point but cannot adjust the size of the bullet

The img i am using seems to be extremely large and i want to decrease it in size so it can fit as a bullet point.我正在使用的 img 似乎非常大,我想减小它的大小,以便它可以作为一个要点。 At the moment it just distorts the whole website and i cannot figure out how to edit the size.目前它只是扭曲了整个网站,我不知道如何编辑大小。

 ul { list-style-position: inside; padding-left: 2rem; list-style-image: url("https://i.ibb.co/NLbMNTw/KA-Icon-Burgundy.jpg"); } ul li{ padding-left: 2rem; }
 p class="section-subtitle"> <ul> <li>Savings on running costs/in-house labour costs</li> <li>Allows you to stay focused on your core-business without distractions. </li> <li>Reduce risk – government regulations non-compliance fines</li> <li>Level the playing field – get access to the similar technology and expertise that big companies enjoy </li> </ul> </p>

CSS list image does not have extended styling offered as background image does so one has to be rather creative to make use background image instead of list image. CSS 列表图像没有像背景图像那样提供扩展样式,因此必须相当有创意才能使用背景图像而不是列表图像。 Secondly list image crops the image where background image can be resized.其次,列表图像裁剪可以调整背景图像大小的图像。

Two example below either case wise.下面的两个例子都是明智的。

Example one: if you need image on UL tag and not on rest of list示例一:如果您需要 UL 标签而不是列表 rest 上的图像

 ul { list-style-position: inside; background: url("https://i.ibb.co/NLbMNTw/KA-Icon-Burgundy.jpg") no-repeat; background-size: 15px; } ul li{ padding-left: 20px; }
 <p class="section-subtitle"> <ul> <li>Savings on running costs/in-house labour costs</li> <li>Allows you to stay focused on your core-business without distractions. </li> <li>Reduce risk – government regulations non-compliance fines</li> <li>Level the playing field – get access to the similar technology and expertise that big companies enjoy </li> </ul> </p>

Example two: if you need image on LI tag as in most cases one would示例二:如果您需要 LI 标签上的图像,就像大多数情况下一样

 ul { list-style-position: inside; list-style-type: none; padding=0; margin=0 } ul li{ background: url("https://i.ibb.co/NLbMNTw/KA-Icon-Burgundy.jpg") no-repeat; background-size: 15px; padding-left: 20px; }
 <p class="section-subtitle"> <ul> <li>Savings on running costs/in-house labour costs</li> <li>Allows you to stay focused on your core-business without distractions. </li> <li>Reduce risk – government regulations non-compliance fines</li> <li>Level the playing field – get access to the similar technology and expertise that big companies enjoy </li> </ul> </p>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM