css特效文字

使用css样式属性

文字肖像特效

-webkit-background-clip: text;

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background: #000;
        }

        .desc {
            height: 100vh;
            overflow: hidden;
            color: transparent;
            line-height: 14px;
            letter-spacing: -.05em;
            font-size: 16px;
            background-image: url('./dist/assets/nx.png'), url('./dist/assets/nx.png');
            background-blend-mode: soft-light;
            background-position: bottom;
            background-repeat: no-repeat;
            background-size: contain;
            background-clip: text;
            -webkit-background-clip: text;
        }
    </style>
</head>

<body>
    <div class="desc">
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML

        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        child element. The used values of that element's background properties are their initial values, and the
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        propagated values are treated as
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
        element is none and its background-color is transparent, user agents must instead propagate the computed values
        of the background properties from that element's first HTML
        if they were specified on the root element. It is recommended that authors of HTML documents specify
        the canvas background for theelement rather than the HTML element.
        For documents whose root element is an HTML element: if the computed value of background-image on the root
    </div>

</body>

</html>

文字蒙版视频

文字背后播放视频 mix-blend-mode

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    video {
        height: 100vh;
        width: 100vw;
    }

    .container {
        position: absolute;
        height: 100vh;
        width: 100vw;
        top: 0;
        left: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #fff;
        mix-blend-mode: screen;
    }

    .container h1 {}
</style>

<body>
    <video preload="auto" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" class="no-cursor" autoplay loop muted>
    </video>
    <div class="container">
        <h1>hello world</h1>
    </div>
</body>
<script>

</script>

</html>

使用svg特性

svg css路径动画

https://pixso.cn/ 新建文件导出svg

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    svg {
        width: 80vw;
        overflow: hidden;
        height: 80vh;
    }
</style>

<body>
    <svg width="783.289673" height="290.340057" viewBox="0 0 783.29 290.34" fill="none"
        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
        <desc>
            Created with Pixso.
        </desc>
        <!-- 删除path的  stroke="#000000"  属性,隐藏路径 -->
        <!--  修改id为自定义值-->
        <path id="wavpath"
            d="M0.394897 250.441C146.395 62.4414 131.395 -116.559 331.395 98.4414C531.395 313.441 623.395 294.441 640.395 284.441C657.395 274.441 813.395 119.441 777.395 31.4414" />
        <!-- <defs /> -->
        <!-- 添加text文字元素 -->
        <text fill="#000">
            <!-- 设置文字路径,为上面svg路径,通过href引用上面的id -->
            <textPath href="#wavpath">
                <!-- 添加文字动画,attributeName设置动画元素需要被改变的属性名。 -->
                <!-- startOffSet 控制文本位置距离路径起始位置的偏移量 -->
                <!-- from to分别定义初始值和结束值 duration定义动画的持续时间 重复 -->
                <animate attributeName="startOffset" from="-50%" to="110%" dur="10s" repeatCount="indefinite"></animate>
                自定义文字动画
            </textPath>
        </text>
    </svg>


</body>
<script>

</script>

</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值