CSS骚操作 --- 制作不同背景的字体

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container{
            position: relative;
            height: 600px;
        }
        .pic{
            position: relative;
            width: 100%;
            height: 100%;
            background: url('./jinse.jpg');
        }
        .text{
            position: absolute;
            font-size: 9rem;
            left: 0;
            top: 0;
            background-color: white;
            width: 100%;
            height: 100%;
            mix-blend-mode: lighten;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="pic"></div>
        <div class="text">金色传说</div>
    </div>
</body>
</html>

效果图

金色字体.png标题

 

主要用到的是mix-blend-mode: lighten;这个css属性
使用 <blend-mode> 表示应该应用的混合模式。可以有多个值,用逗号分隔。

语法


Formal syntax:  <blend-mode>where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminositymix-blend-mode: normal;


mix-blend-mode: multiply;
mix-blend-mode: screen;
mix-blend-mode: overlay;
mix-blend-mode: darken;
mix-blend-mode: lighten;
mix-blend-mode: color-dodge
mix-blend-mode: color-burn;
mix-blend-mode: hard-light;
mix-blend-mode: soft-light;
mix-blend-mode: difference;
mix-blend-mode: exclusion;
mix-blend-mode: hue;
mix-blend-mode: saturation;
mix-blend-mode: color;
mix-blend-mode: luminosity;

mix-blend-mode: initial;
mix-blend-mode: inherit;
mix-blend-mode: unset;
规则说明
初始值normal
适用元素all elements
是否是继承属性
适用媒体visual
计算值as specified
Animation typediscrete
正规顺序the unique non-ambiguous order defined by the formal grammar
Creates stacking contextyes

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值