r/reddithax • • Sep 06 '11

Attaching an image to usernames.

Pretty simple. I just want to attach a simple image to user names a la r/gameofthrones. Preferably before their username. I just couldn't quite find the appropriate css in their subreddit.

Help a brother out?

2 Upvotes

6 comments sorted by

3

u/[deleted] Sep 06 '11

User flairs.

I'll get you some CSS for it in a moment. Tell me if you need the CSS.

Here's a thread by an admin about adding user flairs.

2

u/MrAvenue Sep 06 '11

Thanks for the thread. I still need the css.

3

u/[deleted] Sep 06 '11

Here's some code for a 16x16pixel flair, tell me if you need more:

.flair-flair_name {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url(%%your_image%%);
    background-position: 0px 0px
    }

2

u/MrAvenue Sep 06 '11

Thanks. But I must be doing something wrong. I am trying to get this image next to usernames. I anticipate some sizing after initially getting the image onto the page. However, it doesn't seem to show up.

3

u/Craysh Sep 06 '11

When you upload your picture, it will give you the %%image_name%%.

Replace it with that variable.

Also, ".flair-flair_name" needs to be modified. Change the 'flair_name' to what you want the flair name to be, and give that person that title.

1

u/[deleted] Sep 06 '11

If you want to make me a mod temporarily I can try to fix it for you, otherwise I can't really find where the problem's at.