当前第2页 返回上一页
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!DOCTYPE html>
<html>
<head>
<meta charset= "UTF-8" />
<style>
.demo1 {
color: white;
font-size: 40px;
text-shadow: -1px 1px 0 #000, 1px 1px 0 #000;
}
.demo2 {
color: white;
font-size: 40px;
text-shadow: -1px 1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000,
-1px -1px 0 #000;
}
</style>
</head>
<body>
<p class = "demo1" >为你明灯三千</p>
<p class = "demo2" >为你花开满城</p>
</body>
</html>
|
效果图:

方法2:使用text-stroke属性
text-stroke属性用于向文本添加描边。此属性可用于更改文字的描边宽度和颜色。使用-webkit-前缀支持此属性。
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <!DOCTYPE html>
<html>
<head>
<meta charset= "UTF-8" />
<style>
.demo {
color: white;
font-size: 40px;
-webkit-text-stroke: 1px rgb(250, 190, 255);
}
</style>
</head>
<body>
<p class = "demo" >为你明灯三千</p>
</body>
</html>
|
效果图:
![1622193008698615.png 2JYS${`MT[I7PJ][1F%4%0U.png](http://ypimg.muzhuangnet.com/Collect/csharp/upload/image/119/748/346/1622193008698615.png)
推荐学习:css视频教程
以上就是css中如何给字体加描边的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
css nav-index属性怎么用
如何建立纯css的滑块
css怎么控制字体大小
css text-shadow属性怎么用
css是利用什么xhtml标记构建网页布局
什么是css预编译
前端css如何实现箭头
如何让css样式失效
css修改placeholder样式的方法介绍(代码示例)
css有哪几种选择器
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css中如何给字体加描边