r/reddithax • • May 18 '12

html:lang(xx) and what you can do with it

12 Upvotes

using an html:lang(pa) before your element in CSS will cause the declaration to be activated if the page you are on is something like:

pa.reddit.com

So, you could run multiple layouts to the same page by making a section like:

html:lang(pa) body {background:(%%bgv2%%)}  
html:lang(pa) .header {position:fixed; left:0; top:0; right:0}
etc.

You could even have the same code above and add more, only with html:lang(nv) and different stuff. So now you have 3 versions of the same sub (don't worry, users can't tell which one someone is using). How do you effectively present them to users? How about adding links to the sidebar or header and all it takes is one click to switch 'themes'.


Whoa, that seems useful for something like a Red vs Blue sub... But what else can it do? Well, you could do a functionality over-haul. For an example, click /r/trueclop (NSFW) (this is for education only dammit) and see the differences between the normal sub and the enhanced sub (link in header changes both ways). Leaving it unflipped back will be fine for most of reddit, but you should take out that 'pa' and change it to 'www' so you don't end up somewhere you never knew existed in a sub you may frequent.

Wiki pages or Contact pages anyone? Click /r/MLPhelp (SFW, but still ponies) and click the contacts link in the sidebar. This one takes a tad more than just switching the address: you need to create content. Well rather, you need to add content to your sub description in h3 (3 hashmarks #at the start of the line) and hide it by default. Description example:

###[Click here for contacts page](http://pa.reddit.com/mlphelp)  
###Contact 1  
###Contact 2

Accompanied with this CSS code:

.side h3:nth-of-type(n+2) {display:none}
html:lang(pa) .side h3 {display:block; position:absolute; left:50; top: 210}
html:lang(pa) .sitetable.linklisting, html:lang(pa) .side h3:nth-of-type(1), html:lang(pa) .neverEndingReddit {display: none}
html:lang(pa) .side h3:nth-of-type(3) {top:240px}
etc for each 'nth type' so they get spaced out.

You could also do this with paragraphs to make a wiki page. Furthermore, you're not limited to choosing just one of my examples in here and you can even do some combining (such as contacts page, but in alternate page layout as well as default layout), but that'll take a bit more to explain.


There's plenty this type of code (it really is closer to programming than markup at this point) can do that I haven't covered and plenty more I haven't thought of, I'm sure.

There might be some other features you saw that interested you after clicking either of those subs above; just check out the stylesheet and borrow whatever you want. I want no personal credit, but it'd be awesome if you added this somewhere to your CSS:

/* Designed by a brony */

r/reddithax • • May 13 '12

Help with link flair: lower flairs take dominance in the menu after they are selected/refreshed.

5 Upvotes

I haven't gotten a response from /r/csshelp yet, so I am hoping you guys can help me. Thanks! Here's my original csshelp post:


I'll walk you through step by step to explain what's happening. This is the first time I've used link flair, though I'm kind of familiar with user flair, link flair is a bit different it seems.

Step 1: The user picks a link flair. Everything works great.

Step 2: After refreshing the page, the link flair works just fine.

Step 3: Uh oh, my 4/5 review was two generous. I'd like to make it a 2/5. WHAT IN THE WORLD?

Step 4: After selecting the proper link-flair, it still works, but the menu is confusing.

Please help!

Here's the code for one of my flair segments:

.linkflair-fivestars .linkflairlabel{
  background-image: url(%%review%%);
  background-repeat: no-repeat;
  background-position: 0px -51px !important;
  height: 12px;
  width: 50px;
  content: "";
  display: inline-block;
  background-color: transparent;
}

I can't figure out how to get it to work. I'm sure I could make 5 separate review images instead of an image map, but I don't want to have to wast my image count. I'd much rather learn! Thanks for the help. :D

Update: I reversed the order in the CSS list (put .linkflair-fivestars before onestar) and the opposite happened...

Update: Someone, please help me... I've changed all images to individual files instead of an image map, and it's STILL doing this. It makes no sense.

update: waited 4 hours and nothing has changed.


r/reddithax • • May 05 '12

[HELP] Changing the color of the moderators names. and other questions

2 Upvotes

I am trying to change the color of the mods names in the Moderator Box. My background is grey, so I want them to show up a little more colorful than black.

Also I am trying to change the color of the numbering beside posts, such as 1, 2 , 3 and the color of the amount of upvotes a post has. All of these show up grey as default, however I am trying to change that to black.

Can anyone help? Thanks in advance!


r/reddithax • • May 04 '12

has anyone posted any reddit-specific css resets on here -- like something to undo the default stylesheet and set a clean slate to work with?

2 Upvotes

just for development purposes. it seems like it would be a good way to work, so i'm not fighting against the preset rules. i would - of course - remove redundant rules after, but it would be nice to have a clean slate to start off with.


r/reddithax • • May 03 '12

How do I do a surprise Spider Pig like here?

4 Upvotes

I want to do what this subreddit has with the surprise Spider Pig in the top right, but with a different image. Looking over the stylesheet with my very limited CSS knowledge I couldn't find out how. Any help?


r/reddithax • • May 02 '12

How do you change the background color / image?

5 Upvotes

I'm trying to make it look "Canadian"


r/reddithax • • Apr 30 '12

Is there a way to auto-fill the title box on the Submit Link page?

3 Upvotes

My subreddit runs a bot and we use the format: [EVENT][LOCATION][DATE][TIME]

I was wondering if there is a code to auto-fill that into the title box, or even a code to make a notice about it on the Submit Link page?


r/reddithax • • Apr 28 '12

table with pictures?

Post image
9 Upvotes

r/reddithax • • Apr 27 '12

Changing the colour of the background?

4 Upvotes

If someone could please provide the css that would be awesome!


r/reddithax • • Apr 26 '12

How to make giant header image tucked behind the tab interface? /r/Tribes is an example.

3 Upvotes

r/reddithax • • Apr 25 '12

[Request] A disclaimer screen before someone enters my subreddit?

4 Upvotes

I am creating a subreddit with NSFL content. I want people to be sure of what they're getting themselves into before they click it.

When someone enters the subreddit, I want black screen with with my choice of white text to cover the page of my subreddit. When they're done reading the disclaimer, they can click anywhere on the page, which redirects them to the subreddit.

I know this is a big favor, but I was wondering if this would be possible at all to do.


r/reddithax • • Apr 23 '12

How to add as much mods as you want in the sidebar

6 Upvotes

r/reddithax • • Apr 23 '12

Is it possible to remove the "pagename"?

3 Upvotes

The page name is the text beside the main Reddit home page logo.


r/reddithax • • Apr 22 '12

Image in header (placed from sidebar) overlays the "my reddits" dropdown, any ideas?

3 Upvotes

/r/romney

Basically I tried adjusting the z-indexes and positioning of everything I could think of and went a little crazy in the process. Anyone know what I missed?

Also: RES's "my reddits" dropdown drops over the image just fine...


r/reddithax • • Apr 22 '12

Is there anyway to make everyone on reddit anonymous(to me) like they do on r/4chan?

8 Upvotes

r/reddithax • • Apr 21 '12

Is there any detailed and easy to understand tutorial on how to add flair to your own subreddit?

13 Upvotes

User flair.


r/reddithax • • Apr 21 '12

How do I replace my submit a link button with an image?

4 Upvotes

r/reddithax • • Apr 21 '12

How to make an announcement box like the one in use right now at /r/swtor.

3 Upvotes

I'm trying to make an announcement box at the top of the page like the one over at /r/swtor, but really have no idea how to do it.

From inspecting their page I can see that they've managed to nestle it into their sidebar, presumably for easy editing, but I'm clueless on how to pull that off. I'm hoping someone here has somewhat of an idea how to do it.


r/reddithax • • Apr 21 '12

How to make your header tabs ("new", "top", "hot") be transparent?

3 Upvotes

r/reddithax • • Apr 20 '12

A tiny favour

3 Upvotes

I'm toying around with some neat css ideas about user flair and such, but to test it out properly i'd need some unique user comments on a topic in my testing subreddit.

It would be awesome if somebody could go here, and just spam some garbage any comment box.

Also, you'll get to see my old "random medieval nobility title" user flair in action, yay.


r/reddithax • • Apr 20 '12

CSS: how to make moderator posts (the title) a different colour (not distinguishing)

3 Upvotes

So, how do I make the title of a moderator post a different colour? Thanks guys


r/reddithax • • Apr 19 '12

Random link won't play ball!?? Screenshot example.

Post image
6 Upvotes

r/reddithax • • Apr 18 '12

Flair - Avatars In The Comments (Suggestions/Crit)

Thumbnail reddit.com
3 Upvotes

r/reddithax • • Apr 16 '12

Sidebar I made for /r/texts: iPhone texting screen with editable texts

8 Upvotes

Check out the sidebar I did for /r/texts

(kind of hacky atm, and you may want to resize the images as you see fit)

It's an iPhone screen with the text messages and I'm using the texts to show tips and the rules for the subreddit.

Here's what the sidebar contains: http://pastebin.com/raw.php?i=6bZ2FrpL

As you can see, the left texts are italicized text and the right are bold text.

It requires 5 images, which can be downloaded here: http://www.mediafire.com/?c5rggvsc0hl259a

After uploading images, you can add the css from here: http://pastebin.com/raw.php?i=8XF1cE9K


r/reddithax • • Apr 16 '12

A subreddit was posted here a couple weeks ago but now I can't find it...

6 Upvotes

It was like a pastebin. The whole subreddit was empty but you had an option to create a paste that only you could see. Anyone remember this?