Would it be possible to replace any regular expressions on a website and insert something else via css? Without actually having access to the site and able to create classes etc. Using a plugin like Stylish for example.
example: On the page someone has written a regular smiley
css replaces that smiley with an emoticon
I realise I might get laughed at but that's okay..
Probably not with CSS. But
Probably not with CSS. But with JavaScript yes.
You can only do that if you
You can only do that if you are able to add certain classes or id's to the piece of text.
For example if you add <h4 id="text-replace-image"><span>Smiley</span></h4>
to the website then the following css command would replace it with an image:
h4#text-replace-image { width: 250px; height: 25px; background-image: url(smiley.png); } h1#text-replace-image span { display: none; }
This should replace the id 'text-replace-image' with the smiley.png image and remove the span inside the h4.
But that is about everything you are able to work out with HTML & CSS, just plain text won't be swapped with an image unles you are going to use javascript like Tony said.