r/csshelp • • Mar 10 '12

Need help with adding multiple flairs

So at /r/CatsWithHats I've been tinkering with CSS and I can't seem to be able to add multiple flairs. Can someone help me?

.arrow.down {
visibility: hidden;
display: none
}

.comment .arrow.down {
visibility: visible;
display: block
}

div.titlebox span.word {  
display: none  
}  
div.titlebox span.number:after {  
content: " cat addicts"  
}  

.flair:before{
display:inline-block;
width:28px;
height:25px;
}
.flair-kitty1:before{
content:'';
background:url(%%kitty1%%) 0 0 no-repeat;
}

and I'm trying to add this image labeled nyan http://i.imgur.com/UsHHP.png

Anyone care to help? It would be much appreciated.

6 Upvotes

6 comments sorted by

2

u/TheNinja2203 Mar 10 '12 edited Mar 10 '12

try using this code instead of yours

.flair:before{
    content: "";
    display: inline-block;
    vertical-align: middle;
    margin-right: 3px
}    
.flair-kitty1:before{
    width: 25px;
    height: 25px;
    background-image: url(%%kitty1%%);
}
.flair-kitty2:before{
    width: 45px;
    height: 22px;
    background-image: url(%%nyan%%);
}

This replaces both .flair:before and .flair-kitty1:before. Looks like this

Flair Templates page looks like this

2

u/NvaderGir Mar 10 '12

Wow! Thanks so much :)

1

u/TheNinja2203 Mar 10 '12

I notice you aren't using any text. If you wanted to provide an icon-only version that doesn't have the awkward margin on the right, you could add this to the end of your css:

.flair-notext:before{
    margin-right: 0px
}

And add two new flair templates

2

u/NvaderGir Mar 10 '12

Fixed! Thanks!

1

u/dziban303 Mar 10 '12

I could show you how to do a flair tooltip as well.

But only if you sub to /r/warshipporn

1

u/NvaderGir Mar 10 '12

Bribery, no thanks :P

I'm satisfied with what I have but thanks anyways!