css怎么设置文字描边效果


本文摘自PHP中文网,作者V,侵删。

css设置文字描边效果的方法:可以利用text-stroke-color属性来进行设置,如【-webkit-text-stroke-color:#ff0;】。属性text-stroke-color用来设置或检索对象中的文字的描边颜色。

相关属性:

text-stroke-color:<color> 属性设置或检索对象中的文字的描边颜色

(学习视频分享:css视频教程)

属性值:

<color>:指定文字的描边颜色。

兼容性:

82f017d91b1c2c667e018ef4efb6373.png

举例:

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" />

<title>text-stroke-color</title>

<style>

html,body{font:bold 14px/1.5 georgia,simsun,sans-serif;text-align:center;}

.stroke h1{margin:0;padding:10px 0 0;}

.stroke p{

margin:50px auto 100px;font-size:100px;

-webkit-text-stroke-width:2px;

-webkit-text-stroke-color:#ff0;

}

.copyright,.info{font-style:italic;}

</style>

</head>

<body>

<body>

<div>

<h1>描边的文字:</h1>

<p>我是被描了2像素黄边的文字</p>

</div>

</body>

</html>

相关推荐:CSS教程

以上就是css怎么设置文字描边效果的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css属性为什么要加前缀

什么是css预处理器

css如何去除边框

css选择器first-child与first-of-type之间有什么区别?

css怎么设置网页标题栏图标

css如何让高度自适应

css如何隐藏x轴坐标

css文字颜色渐变的三种实现方式(附代码)

怎样实现meta标签中的viewport来控制设备屏幕的css属性

外联css怎么写

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...