How can I replace text with CSS?

前端 未结 21 2451
暗喜
暗喜 2020-11-22 06:17

How can I replace text with CSS using a method like this:

.pvw-title img[src*=\"IKON.img\"] { visibility:hidden; }

Instead of ( img

21条回答
  •  时光取名叫无心
    2020-11-22 07:02

    The way to make this work is to add line-height to the CSS content. This will make the block to be seen above the hidden, thus this will not hide the changed text.

    Example with use before:

    .pvw-title span {
      display: none;
    }
    
    .pvw-title:before {
      content: 'Whatever it is you want to add';
      line-height: 1.5em
    }
    

提交回复
热议问题