How can I replace text with CSS?

前端 未结 21 2199
暗喜
暗喜 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 06:55

    Text replacement with pseudo-elements and CSS visibility

    HTML

    Original Text

    CSS

    .replaced {
        visibility: hidden;
        position: relative;
    }
    
    .replaced:after {
        visibility: visible;
        position: absolute;
        top: 0;
        left: 0;
        content: "This text replaces the original.";
    }
    

提交回复
热议问题