Is it possible to mask a
, or to overlay text with a masked image?

前端 未结 1 1927
梦如初夏
梦如初夏 2021-01-26 19:00

I\'m almost sure this is not possible, but just wanted to ask if I\'m correct.

I have a container with a solid background color and with text in it. This floats over a

相关标签:
1条回答
  • 2021-01-26 19:23

    There is an property in for webkit based browsers called -webkit-background-clip: text. Write like this:

    p{
        background-image:;
        background:  url(http://2.bp.blogspot.com/-NSwhl6hv41Y/Th5EIJL_zZI/AAAAAAAAFc4/UGUNfb--tGc/s1600/vector_wallpaper_by_seppoftw.jpg);
        -webkit-background-clip: text; 
        -webkit-text-fill-color: transparent;
        font-size:100px;
        margin:40px;
    }​
    

    Check this http://jsfiddle.net/yvYG8/

    Read this for more http://trentwalton.com/2011/05/19/mask-image-text/

    0 讨论(0)
提交回复
热议问题