How can I replace text with CSS?

MokiTa picture MokiTa · Oct 25, 2011 · Viewed 857k times · Source

How can I replace text with CSS using a method like this:

.pvw-title img[src*="IKON.img"] { visibility:hidden; }

Instead of ( img[src*="IKON.img"] ), I need to use something that can replace text instead.

I have to use [ ] to get it to work.

<div class="pvw-title">Facts</div>

I need to replace "Facts".

Answer

Matthew Cachia picture Matthew Cachia · Dec 18, 2012

Or maybe you could wrap 'Facts' round a <span> as follows:

<div class="pvw-title"><span>Facts</span></div>

Then use:

.pvw-title span {
  display: none;
}
.pvw-title:after {
  content: 'whatever it is you want to add';
}