写一个文字滑动切换样式效果

 

<template>
    <div class="mainrouter centerWindi">
        <h1>2024,马上暴富</h1>
    </div>
</template>
<style lang="scss">
/* 居中 */
.centerWindi {
    @apply flex justify-center items-center;
    text-align: center;
}

/* 路由 */
.mainrouter {
    background-color: white;
    width: 100%;
    height: 150%;
    border-radius: 4px;
    padding: 25px;
}

h1 {
    //color:coral;
    font-size: 80px;
    font-weight: 700;
    //设置透明度
    background: linear-gradient(to bottom, coral 50%, white 50%)
    // 背景居中显示,背景大小为100%,固定背景
    center center / 100vw 100vh fixed;
    // height: 100vh;
    width: 100%;
    // 背景只覆盖文字
    background-clip: text;
    -webkit-background-clip: text;
    // 将背景色换位透明
    color:transparent;
    // 设置描边
    -webkit-text-stroke: 2px coral;
}
</style>

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值