css中如何给字体加描边


当前第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>

效果图:

57WS21}XTIUIF212`X9`RT5.png

方法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>

效果图:

2JYS${`MT[I7PJ][1F%4%0U.png

推荐学习:css视频教程

以上就是css中如何给字体加描边的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

css nav-index属性怎么用

如何建立纯css的滑块

css怎么控制字体大小

css text-shadow属性怎么用

css是利用什么xhtml标记构建网页布局

什么是css预编译

前端css如何实现箭头

如何让css样式失效

css修改placeholder样式的方法介绍(代码示例)

css有哪几种选择器

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




打赏

取消

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

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

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

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

评论

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