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