css文字背景剪切

在做文字背景剪切的时候用到   -webkit-background-clip: text,属性

<style>
    div{
      /* background-color:crimson; */
      background: url(images/2.jpg);
      background-size: cover;
      width: 300px;
      height: 300px;
      font-size: 60px;
      text-align: center;
      font-weight: bold;
      line-height: 300px;
      color:transparent;
      -webkit-background-clip: text;
    }
</style>
<div>
    content
</div>

效果图如下: 

 

posted @ 2018-09-14 11:27  四叶草2010  阅读(735)  评论(0编辑  收藏  举报