Watermark text repeated diagonally css/html

前端 未结 5 836
醉话见心
醉话见心 2020-12-16 00:20

How can I achieve the following watermark text (\"howbloggerz\") with css/html?

5条回答
  •  孤街浪徒
    2020-12-16 01:03

    If it is only to lay a text over the image, here is another possible css option with drop-shadow and a pseudo (text-shadow works too)

    .watermarked:after {/* draw the watermark at screen*/
      color: rgba(0, 0, 0, 0.4);
      content: 'watermarked watermarked watermarked';
      word-spacing: 3em;
      transform: rotate(-60deg);
      filter: 
      drop-shadow(2em 3em  #000) 
      drop-shadow(4em 6em  #000) 
      drop-shadow(8em 12em #000) 
      drop-shadow(-15em -24em #000)
      ;
    }
    
    /* makeup */
    .watermarked {
      width: max-content;
      border: solid;
      display: grid;
      overflow: hidden;
    }
    
    img,
    .watermarked:after {
      grid-row: 1;
      grid-column: 1;
      margin: auto;
    }

提交回复
热议问题