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 type discrete
正規順序 the unique non-ambiguous order defined by the formal grammar
Creates stacking context yes

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章