当前已知可以通过如下方式实现渐变色文字,如何给文字添加一个边框呢?
h1 {
font-weight: 800;
color: #24934a;
background: linear-gradient(90deg, #30cf68 0%, #00a9df 100%);
/* stylelint-disable-next-line property-no-vendor-prefix */
-webkit-background-clip: text;
background-size: 100% 100%;
-webkit-text-fill-color: transparent;
}
感谢回答中提供的方法,通过 -webkit-text-stroke: 0.5px white;
可以实现为文本添加 border 的效果,但 font-weight
失效了,有其他办法解决吗?