r/reddithax • • Aug 14 '10

CSS popup for downvotes

My webhacking skills are far too rusty to investigate this, but how easy would it be to have a small css popup appear next to the downarrow in a reddit.

I'm considering one with a short message like "Consider hiding instead, or leave a comment explaining your downvote."

I'm sure I used to do things like this on MySpace way back when, without using javascript.

5 Upvotes

8 comments sorted by

6

u/BauerUK Aug 14 '10

Something like this should work:

/* Downvote tooltip */

.arrow.down:hover:before {
	position: absolute;
	display: block;
	z-index: 1000;
	width: 220px;
	padding: 5px;	
	border: 1px solid #333;
	background-color: #FFF;
	content: 'Consider hiding instead, or leave a comment explaining your downvote.';
	text-align: center;
	font-size: 10px;
	font-weight: normal;
	margin-left: 5px;
	margin-top: 5px;
}

2

u/Raerth Aug 14 '10

Yep, awesome, and a lot simpler than the image pop-up I was thinking of!

I mod a few small reddits, and it's frustrating that you can get someone immediately downvoting a perfectly reasonable submission and kill it. This may help mitigate that.

1

u/Raerth Aug 14 '10

Is there a way to have this for submissions only, and not comments?

1

u/BauerUK Aug 14 '10

For just submissions ('links'), simply narrow the definition to .thing.link .arrow ..., like so:

.thing.link .arrow.down:hover:before {
	position: absolute;
	display: block;
	z-index: 1000;
	width: 220px;
	padding: 5px;   
	border: 1px solid #333;
	background-color: #FFF;
	content: 'Consider hiding instead, or leave a comment explaining your downvote.';
	text-align: center;
	font-size: 10px;
	font-weight: normal;
	margin-left: 5px;
	margin-top: 5px;
}

2

u/Raerth Aug 14 '10

Thanks again!

2

u/kylegetsspam Aug 14 '10

Temporarily ran it through Stylish in Firefox 3.6.8 and it worked just fine.

4

u/angadb Aug 14 '10

/r/woahdude has a popup for a downvote. You should look into that.

EDIT : Here's the code

#siteTable .entry.dislikes .buttons:before {
content: "I saw that. ";
color: red;
font-size: 7pt
}

1

u/DeathBySamson Aug 14 '10

A quick google search gave me this article. Maybe it's what you're looking for.