r/csshelp • • Apr 15 '15

Resolved Customizing the "My Subreddits" drop-down arrow. NSFW

Subreddit: NSFW /r/holdthemoan

Stylesheet: /r/holdthemoan/about/stylesheet

Re: http://reddit.com/r/csshelp/comments/txq5v/changing_the_color_grey_dropdown_arrow_for_my/

.dropdown.srdrop .selected {
    background: url(%%spritesheet%%) no-repeat -120px -100px; width: 11px; height: 6px;
}

Issue:

How would I solve this positioning problem?


Solution:

Well this took a long time but I finally came up with a solution. Since I couldn't position the spritesheet image and the "My Subreddits" text correctly, I decided to make the entire thing an image: https://i.imgur.com/KfyLllF.png. So I got rid of the text with text-indent: -999em;, set padding: 0px; as well as display: block; and placed various margins to position the image exactly as I wanted. This is optional, but I also added a hover effect with:

.dropdown.srdrop .selected:hover {
    background: url(%%spritesheet%%) no-repeat -100px -20px; width: 93px; height: 8px;
}

Hope this helps someone. Cheers!

9 Upvotes

4 comments sorted by

2

u/Hajson Apr 16 '15
.dropdown.srdrop .selected {
background: url(%%spritesheet%%) no-repeat -120px -100px; width: 11px; height: 6px; margin-right: 4em;

}

1

u/dehydro Apr 16 '15

The margin-right doesn't seem to make a difference. I've added it to the sub so you can see it live, but even with margin-right: 100px; the issue remains: https://i.imgur.com/UY4wEJj.png. Any ideas?

2

u/Hajson Apr 16 '15

seems like theres multiple sections for the "my subreddits" section, i suggest doing a browser search .sr in your stylesheet. some of which you likely won't need if its a spritesheet.

1

u/dehydro Apr 16 '15

Would any of the following blocks be causing the issue? These are all 7 other instances of .sr but they seem like arbitrary properties.

.sr-bar a {
    color: #efefef;
}

.dropdown.srdrop .selected {
    color: #efefef !important;
}

.sr-bar a:hover {
    text-decoration: none;
}

.dropdown.srdrop .selected {
    color: black;
}

.drop-choices, .drop-choices.srdrop.inuse {
    opacity: 0.95;
    background: #e6e6e6;
    line-height: 14px !important;
    margin-left: -1px !important;
    padding: 3px
}

.srdrop .choice.bottom-option {
    border-top: 0;
    font-style: normal;
}

.drop-choices a:hover, .drop-choices.srdrop.inuse a:hover, .dropdown.lightdrop .selected {
    color: orangered !important;
    background-color: transparent !important;
}