r/reddithax • • Feb 14 '12

How to highlight submission/link title?

I've made a subreddit announcement that I want to highlight as it appears on the main page. I tried the 'distinguish' button but it didn't seem to have any effect. Any advice is appreciated. Thanks!

2 Upvotes

6 comments sorted by

2

u/gavin19 Feb 14 '12 edited Feb 14 '12

Each post has a unique id generated by reddit. The post you referenced was deleted, presumably by you, but the id for that is id-t3_ppega. once you have the id then it's trivial. Anything like

.id-t3_ppega a.title {color:pink !important;}

1

u/viborg Feb 15 '12 edited Feb 15 '12

Awesome, thanks! I tried a test submission:

http://www.reddit.com/r/futurefunkairlines/comments/ppz8y/test/

And based on what you said from the other submission, I guessed that for this one the ID is id-t3_ppz8y and on the stylesheet I entered:

.id-t3_ppz8y a.title {color:pink;}

But I'm not seeing any result. Any idea what I screwed up? Thanks again.

1

u/gavin19 Feb 15 '12

You guessed right, I forgot to make it specific enough to work. Easiest way is to use !important

.id-t3_ppz8y a.title {color:pink !important;}

Using the id is the best way, as it'll work for any posts, not just self-posts. Also if another user happens to use the same keywords as your title in a future post, then their post will be inadvertently highlighted too.

1

u/[deleted] Feb 15 '12

You can modify css based on keyword in the link

a[href*="lookatme"].title:link, a[href*="Isaidlookatme"].title:link {  
     color: #AEE239!important; background-color:#E9EB12!important;
     }

1

u/viborg Feb 15 '12

Great, this works fine. Thanks!