发光与渐变的字体耶

285 阅读1分钟

发光字体

1.字体发光代码

<!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>
        div {
            font-size: 28px;
            font-weight: bold;
            color: #f5f9ff;
            text-shadow: 0 0 5px #ff1200, 0 0 10px #ff1200;
        }
    </style>
</head>

<body>
    <div>嗨,好久不见!</div>
</body>

</html>

2.字体发光效果

image.png

渐变字体

1.字体渐变代码

<!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>
        div {
            background: linear-gradient(to bottom, #fff, #ffdc73);
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
            font-size: 28px;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div>嗨,好久不见!</div>
</body>

</html>

2.字体渐变效果

image.png