纯CSS实现字体上下部分颜色不同的效果

先上实现效果:
在这里插入图片描述

代码如下:
==================style==================

		span {
            font-size: 150px;
            font-weight: 900;
            font-family: 'Courier New', Courier, monospace;
        }

        .left {
            margin-top: 20vh;
            position: absolute;
        }

        span::before {
            position: absolute;
            height: 50%;
            content: attr(content);
            overflow: hidden;
            color: sandybrown;
            z-index: 999;
        }

==================html==================

	<div>
        <div class="left">
            <span content=""></span>
            <span content=""></span>
        </div>
    </div>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章