How to make “see through” text?

后端 未结 2 1081
南方客
南方客 2020-12-06 03:30

I have body with a background-image and a div with background-color as white.

I\'m trying to make the text on tha

2条回答
  •  没有蜡笔的小新
    2020-12-06 03:45

    Try clipping for your #content, assign the same background file (needs to be repositioned eventually):

    #content {
     color: rgba(255,255,255,.5);  /* Fallback: assume this color ON TOP of image */
     background: url(image.jpg) no-repeat;
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
    }
    

    Source: http://css-tricks.com/image-under-text/

提交回复
热议问题