- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi – is there any css that can find specific content on a page and replace it with something else. Example if the word ‘apple’ is on the page, I would like to replace it with ‘pear’ OR add a graphic next to the word ‘apple’ OR make the word ‘apple’ bold ?
I know of the :before and :after css, but that is not specifically what i am looking for.
Find the word and replace it or add css to a specific word.
thanks – jerryr
You can’t (and shouldn’t) do that with just CSS.
You can target the ‘word’ if you use CSS id or class on it.
<p>So if I'm the <span class="my-special-word">word</span>, you can place span around me</p>
In your CSS.
.my-special-word {
font-weight: bold;
}
With CSS you can make stylistic presentation changes, you can not however replace the word with CSS. You will need to use JavaScript for that functionality.
As you can see…there is no ‘replacement’ function.
Would you care to explain more about what it is you are trying to do…and why?