繁体   English   中英

使用 css 添加带有复选标记的填充圆

[英]add fill circle with checkmark using css

我想在 li 元素之前添加带有复选标记的填充圆圈。 但无法得到如何做到这一点。 任何人都知道然后让我知道。

<ul class="my-work" style = "list-style-type: none;">
  <li>Sheets that stay securely in place</li>
  <li>Boxer elastic corner construction</li>
  <li>Unique corner stitching creates snug fit</li>
  <li>Self adjusts to fit mattresses from 7”-18” deep</li>
</ul>

请检查附件的img

在此处输入图像描述

如果有人有想法,请告诉我。

您可以对带有您喜欢的复选标记的字体使用不同的字体系列。

 .circle-checkmark { font-family: sans-serif; background: lightblue; color: white; padding: 1px 4px; border-radius: 50%; } ul { list-style-type: none; } li { margin: 4px 0; } li::before { font-family: sans-serif; content: "✔"; color: white; display: inline-block; width: 1em; background: lightblue; padding-left: 3px; border-radius: 50%; margin-right: 1em; }
 <h2>Regular checkmark</h2> <span class="circle-checkmark">✓</span> <h2>Heavy checkmark</h2> <span class="circle-checkmark">✔</span> <h2>Something like this can also work</h2> <ul> <li>first</li> <li>second</li> </ul>

另一种选择是使用图像和list-style-image: url(/path/image.png);

更新:我添加了引导检查图标https://icons.getbootstrap.com/icons/check-lg/

 .check-icon{ display: flex; justify-content: center; align-items: center; height: 25px; width: 25px; color: #fff; background: #89CFF0; border-radius:50%; margin-right:10px; } li{ margin:10px } svg{ height:15px;width:15px }
 <ul class="my-work" style = "list-style-type: none;"> <li style='display: flex'><span class="check-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-lg" viewBox="0 0 16 16"> <path d="M13.485 1.431a1.473 1.473 0 0 1 2.104 2.062l-7.84 9.801a1.473 1.473 0 0 1-2.12.04L.431 8.138a1.473 1.473 0 0 1 2.084-2.083l4.111 4.112 6.82-8.69a.486.486 0 0 1.04-.045z"/> </svg> </span> Self adjusts to fit mattresses from 7”-18” deep</li> </ul>

暂无
暂无

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

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