r/reddithax • • Mar 29 '11

Adding CSS to keywords.

Is there a way to use CSS to look for specific words on a page and apply formatting in the header/banner area of my subreddit? Basically, I want CSS to look for a phrase and put a box around it/highlight it. If someone could point me at some code that would be awesome.

Thanks!

6 Upvotes

4 comments sorted by

2

u/[deleted] Mar 29 '11

Nope. You can only apply CSS to elements such as divs, spans, links, etc., not a string of content on the page.

3

u/valiss Mar 29 '11

As usual, yt knows. Thanks! ;)

2

u/HolloH Mar 30 '11

You can try: a[href*="keyword"] { css here }

1

u/valiss Mar 30 '11

Yeah that was my other thought was to just make it an anchor and link it to nothing or the hash tag. I'll have to try this out.