gpt4 book ai didi

html - 如何使用CSS获取轮廓刻度?

转载 作者:太空宇宙 更新时间:2023-11-04 06:21:05 25 4
gpt4 key购买 nike

enter image description here我正在尝试在我的应用程序中添加勾号。目前我的背景是黑色。您能告诉我如何添加outline tick

这里是代码 https://jsbin.com/cilocakedu/edit?html,css,output

.img {
width: 200px;
opacity: 0.5
}

.image-container {
position: relative;
text-align: center;
}

.icon {
position: absolute;
top: 50%;
left: 50%;
font-size: 5rem;
transform: translate(-50%, -50%);
}

最佳答案

听起来您正在寻找一个透明但带有黑色轮廓的复选框。您可以尝试将其添加到您的 .icon 类中:

color: transparent;
-webkit-text-stroke: 2px black;

请注意“-webkit-text-stroke”适用于大多数现代浏览器:

https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke#Browser_compatibility

关于html - 如何使用CSS获取轮廓刻度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55506059/

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