Is it possible to apply CSS to half of a character?

后端 未结 19 1946
轻奢々
轻奢々 2020-11-22 16:46

What I am looking for:

A way to style one HALF of a character. (In this case, half the letter being transparent)

Wh

19条回答
  •  醉话见心
    2020-11-22 17:12

    A nice WebKit-only solution that takes advantage of the background-clip: text support: http://jsfiddle.net/sandro_paganotti/wLkVt/

    span{
       font-size: 100px;
       background: linear-gradient(to right, black, black 50%, grey 50%, grey);
       -webkit-background-clip: text;
       -webkit-text-fill-color: transparent;
    }
    

提交回复
热议问题