css —— 文字添加白色描边
实现代码:
.box{
width: 200px;
height: 200px;
background-color: plum;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: 600;
color: #666666;
}
.text{
margin-bottom: 15px;
}
.stroke{
text-shadow:-1px 0 white,0 1px white,1px 0 white,0 -1px white;
}
<div class="box">
<div class="text">
没有添加描边
</div>
<div class="stroke">
添加了白色描边的效果
</div>
</div> 实现代码: .box{ width: 200px; height: 200px; background-color: plum; display: flex; flex-direction: column; justify-content: center; align-items: center; font-weight: 600; color: #666666; } .text{ margin-bottom: 15px; } .stroke{ text-shadow:-1px 0 white,0 1px white,1px 0 white,0 -1px white; }
没有添加描边
添加了白色描边的效果
