How can I replace text with CSS?

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

    Using a pseudo element, this method doesn't require knowledge of the original element and doesn't require any additional markup.

    #someElement{
        color: transparent; /* You may need to change this color */
        position: relative;
    }
    #someElement:after { /* Or use :before if that tickles your fancy */
        content: "New text";
        color: initial;
        position: absolute;
        top: 0;
        left: 0;
    }
    

提交回复
热议问题