How can I replace text with CSS using a method like this:
.pvw-title img[src*=\"IKON.img\"] { visibility:hidden; }
Instead of ( img
Obligatory: This is a hack: CSS isn't the right place to do this, but in some situations - eg, you have a third party library in an iframe that can only be customized by CSS - this kind of hack is the only option.
You can replace text through CSS. Let's replace a green button that has the word 'hello' with a red button that has the word 'goodbye', using CSS.
Before:
After:
See http://jsfiddle.net/ZBj2m/274/ for a live demo:
Here's our green button:
button {
background-color: green;
color: black;
padding: 5px;
}
Now let's hide the original element, but add another block element afterwards:
button {
visibility: hidden;
}
button:after {
content:'goodbye';
visibility: visible;
display: block;
position: absolute;
background-color: red;
padding: 5px;
top: 2px;
}
Note:
visibility
. Note display: none
on the original element doesn't work.