How can I replace text with CSS?

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

    Based on mikemaccana’s answer, this worked for me

    button {
      position: absolute;
      visibility: hidden;
    }
    
    button:before {
      content: "goodbye";
      visibility: visible;
    }
    

    § Absolute positioning

    an element that is positioned absolutely is taken out of the flow and thus takes up no space when placing other elements.

提交回复
热议问题