• CSS如何给文字添加描边效果?
  • 发布于 2个月前
  • 633 热度
    0 评论
在 CSS 中可以使用 text-stroke 属性使文本更易读,它会向文本添加轮廓效果。
h1 {
 color: #fff;
 font-size: 80px;
  -webkit-text-stroke: 2px crimson;
  text-stroke: 2px crimson;
}
效果如下:

注意如下这句


text-stroke: 2px crimson;


text-stroke 属性值中有两部分,第一部分是文字描边的宽度,第二部分是文字描边的颜色,crimson是深红色的意识。

用户评论