How can I replace text with CSS?

前端 未结 21 2208
暗喜
暗喜 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:16

    This isn't really possible without tricks. Here is a way that works by replacing the text with an image of text.

    .pvw-title{
        text-indent: -9999px;
        background-image: url(text_image.png)
    }
    

    This type of thing is typically done with JavaScript. Here is how it can be done with jQuery:

    $('.pvw-title').text('new text');
    

提交回复
热议问题