I aim to make Double Standard a fairly authoritative coding resource site, with a little design advice thrown in for good measure. I try to adapt "real world" techniques for Neopets and suggest better coding strategies that you may not have otherwise thought of. None of this is "new" information, but hopefully the collection will help you on your adventures! Oh, and I'm Arie.
All of the content on Double Standard is written by me unless otherwise stated. All premade templates are for your use, so long as you credit Double Standard where you are using the code. I am not currently looking for help, but I will in the future. If you're interested, keep your eyes peeled!
About the "coming up" section: I like to keep my readers in the loop by updating them on what's up next and how many ideas I'm currently working on. The article/tip/template featured there should be, unless some virtual or natural disaster prevents me from doing so, uploaded soon. The numbers below that will tell you how many articles/tips I'm writing, how many templates I'm coding as well as how many posts are ready to be uploaded. Why don't I upload them all at once? So that I can update consistently. I give you that information so that you know to check back for more content in the near future and to satisfy a curiosity you never knew was there.
Margins Collapse, Padding Doesn't
added Feb 1, 2013
This little-known fact trips me up a lot when I'm digging through other people's work. I'll wonder why nothing obeys the set margins, or why there's so much space where there shouldn't be. To expand on the title, when working with CSS, margins collapse against other margins; padding does not collapse against other margins or other padding.
Let me lay it out for you with an example. You have two divs one on top of another. Assume you've used a reset to make sure that to start, all margins and padding are set to 0. You give the top div a margin of 20px and the bottom div a margin of 30px. The larger one wins. Always. So between your two divs, you will have only 30px of space, not 50px like you'd imagine. However, if you had 20px of padding on the top and 30px of padding on the bottom, it behaves like you'd think and gives you 50px of space between the divs.
Try experimenting on your own to see it in action. Also keep in mind that floats and positioning plays havoc with margins and padding (in certain scenarios), so to get a good, controlled test going, you'll need to use a reset and avoid floating or positioning your test elements.
Come across anything strange? Am I totally out to lunch? Give me a shout!
Good News For Petpage Coders
added Feb 7, 2013
I'm brain dead, so I'm going to let these messages speak for themselves.

(Hover for full size. Displayed with permission from Zixi.)

LIEK OMG GUYS, WE MIGHT GET 21ST CENTURY CODING ON PETPAGES SOON!
I'm not getting my hopes too high on it being in the very near future, but it's nice to know that it's "on the radar", as Zixi put it.
Oh, and here's that doctype article mentioned above.
What do you think? Is this as exciting as I think it is, or are doctypes overrated? Let me hear it!
Poll: What browser do you use most often on Neopets?
added Jan 13, 2013
And the results are in! I took significantly less time to collect this poll since I got a whopping 180 responses in the first two days. (Yay!) Here are the stats:

The coder in me is pleased with these results. I was surprised that Chrome has such a lead over Firefox (I expected them to be a little more even), but I'm not at all shocked that IE use is greater than Safari or Opera.
There's more
Of those that gave me their browser version, 91% were using the latest version of their browser. That's good news. It means we can code for modern browsers without leaving too many people behind. I wouldn't do it at the expense of your users who use older browsers, though. If the new features on your page don't work, you should at least provide them with an alternative.
Keep in mind...
- People who answer these types of polls are likely browser-savvy already (meaning that they're more likely to make an educated choice about their web browser rather than using what comes loaded on their machine).
- On top of that, I can only reach people who use the Neoboards and read my site. So these statistics aren't accurate for ALL Neopians. Neither will these statistics be completely accurate for your site or guild. You should find out what browsers your readers/members use before discounting, say, IE or Opera. (And here's another thought: As your content becomes more personally important — like in a guild — your users are going to expect you to code for them, even if they're the only one of the group who uses that browser.)
- These results were collected from the English boards! If your page is directed towards non-English-speaking users, don't rely on these stats as browser use varies greatly by country.
- Chrome and Firefox have auto-update options, so there's a good chance your Chrome and Firefox users will always be up-to-date.
- It doesn't matter what version of IE people use; it always reverts back to quirks mode (IE5.5!) on petpages. :( But there is hope for userlookups, guild layouts and the like! IE10 may behave properly, but I haven't tested it! I'll get there, don't worry.
- People use more than one browser when visiting Neopets if they're logged into more than one account at the same time. This poll does not take those "second choice" browsers into account.
- THIS IS INFORMAL RESEARCH. (Duh.) If browser stats are vitally important to you, you'll need to do your own digging.
Interesting
Some Chrome users specifically stated that they don't use Firefox because it lags for them and Chrome runs smoother. Maybe this is the reason why Chrome's stats are so much higher than Firefox's?
Collection
In case you're wondering about how I got these results, I'll share with you. I created boards on the AC, PC, GC and HC from Jan 7-8 asking what browser people use, along with their browser version. If people supplied more than one response, I asked them to choose which they use more often or if they were equal, which was their favourite. I also had the question at the top of this site with links to neomail me. Browser version was an optional part of the poll, and not everyone gave it.
And that's it! Got any bursts of inspiration regarding these results? Think I can improve my methods? Contact me.
Controlling The Petpage Copyright Fluff
added Jan 1, 2013
These days, petpage coders have either accepted the fact that the copyright fluff is going to be part of their page or they try to pretend it doesn't exist. Ultimately, you have two choices: you can work with it, or you can hide it.

Before we get into how you can control or hide the fluff, there are a few things about it that you should know:
1. TNT's filters will automatically close any opened divs for you, so you can't control the div that TNT's copyright fluff goes in anymore.
2. If you're hiding the fluff, you may get a warning from TNT about hiding their copyright notice (though I've yet to meet anyone who's had this happen).
3. The copyright fluff is centered. (With a center tag!) If your layout is positioned to the right or left (even if it's not absolutely positioned!), your layout may not cover the copyright text at all screen sizes.
4. There are several br tags that come before the copyright text. These will act like a margin that you can't control (effectively).
Hiding The Fluff
To hide the copyright, you need to set it to display: none; This usually won't be a problem, but if you use the center tag in your code (please don't), you need to make sure you set those to display: block; Here's how:
center { display: none; }
If your center tag is contained in another div select it using that divs id or class:
#wrapper center { display: block; }
Easy peasy, yeah? But I don't advocate hiding the fluff, so here's another solution:
Controlling The Fluff
To control the copyright – that is, to position it in a place that it's not naturally inclined to go, like 600px down and 200px to the left – you simply have to decide where you want your fluff to go and then add CSS that reflects that:
Here's an example of a situation where I wanted the fluff to line up with my content instead of always being centered on the page:

Again, with this method, you have to be careful not to use tag in your code (or at least to overwrite these styles by adding a class or ID).
Another Option
You have one more option — and this is my favourite, because I'm a lazy coder:
Leave it where it is.
Since the fluff is grey, centered and padded with all those ugly tags, it's not all that obtrusive. Unless your entire layout is floated or positioned, it'll naturally sit at the end of your page, like it does here on 2xS.
Do you have other suggestions? Questions? A specific scenario that's not covered in this article? Contact me!
When The "Save Changes" Button On Your Petpage Preview Disappears
added Dec 21, 2012
A lot of people have a problem finding the "Save Changes" button on petpage previews because of the way they code their page. You have to remember that when you code your petpages, wherever the "Save Changes" button appears is where the copyright fluff will appear. If you're hiding the copyright fluff, you're also hiding your button.
Honestly, I don't advocate hiding the copyright message. It's easier to leave it in place than to hide it. If you're having problems taming the fluff, check out this article, which outlines how you can position it where you want or how to make sure it's hidden effectively.
If you are going to hide the fluff (and therefore the "Save Changes" button) on your page, though, here's my one and only tip:
Use Firefox or Chrome to update your petpage. On the preview, go to View » Page Style » No Style. (Firefox has this functionality built in. If you use Chrome, you may have to install an addon.) Then you'll be able to scroll all the way to the bottom of your content to see the button. Afterwards, you can turn styles back on by going to View » Page Style » Basic Styles (or the equivalent).
Suggestions? Comments? Send them to me!
Hide Your Guild Logo
added Dec 21, 2012
On guild layouts, there are occasions (actually, most of the time), where your logo just isn't meant to be seen on the home page. Some people try to position their sidebars high enough to hide it, but that method can be unreliable, so here's a better way to hide it all together:
img[alt="Your Guild's Name Here"] { display: none; }
That code selects all images with the alt attribute of "Your Guild's Name Here". Make sure that the guild name you put between the quotes is exactly the same as your guild's name, including any symbols or spaces you may have put in there. (A good rule of thumb is to copy and paste it from the field above your guild description!)
And it's gone! I've included this in my guild reset CSS, for your convenience.
We Need To Help The Newbies Again
added Dec 19, 2012
I'm not suggesting that we all need to rush the Newbies board and explain how Neopets works. The newbies I'm referring to are people who are new to design and coding. I believe that if we want to see the graphic community on Neo grow, we need to go back to helping each other instead of waving our skills in their faces, laughing maniacally and dancing just out of reach.
Maybe I'm too idealistic for this crowd, but the way I see it, the only way we're going to improve our own skills is through healthy competition and sharing ideas. None of us think exactly the same as another. We all approach problems differently. Someone might have a slightly better solution to an issue than I do. And when I learn the slightly better method, I can improve upon it using my own experience, and then others can improve upon my improvement, and we keep building each other up until we have something... well, amazing. That's how awesomeness is created: not by yourself, but as a vibrant community.
But how are we supposed to improve upon ideas if there's no one to share with? And how are we supposed to motivate ourselves to find something new and exciting if there's no one around to best us? Competing with yourself is a drag, let's face it. And the amount of designers and coders on Neopets right now is sad. We may not all have outstanding raw talent, but anyone can bring perspective and skill to the community if they learn about the topic.
So here's my call to action: Take the egos down a notch. (You don't know everything. I don't know everything!) Encourage new coders and designers to learn by allowing them to ask questions without being ridiculed or criticized. Speaking of criticism, constructive criticism only, please! Many people who face the obnoxious wrath of defensive elitists won't have the courage to try again, and then how are they supposed to get any better?
If my begging hasn't convinced you yet, consider this: Neopets would be prettier if more people could design better.
Guild Reset CSS
added Dec 15, 2012
I have this tip about reseting browser defaults on petpages and it occured to me that the same can be done on guilds. Except on a guild, you're not reseting browser defaults so much as you're reseting TNT's existing styles. At any rate, I used to use this in every guild layout I made, because it was generic and I didn't want to think about it more than once. Now you're free to use and edit it if you wish!
In case you're wondering what it all does:
The first line resets the most irritating styles on #main: the 1000px width and the centering.
The second line removes backgrounds from the guild stats and "guild content" area, basically making the wide content area invisible.
Line three removes a whole bunch of things, namely your guild logo (you'll have to replace that with your guild's name as per this tip), the guild's name, neighbourhood and description, the header, footer, a random line across the top of the page (lovely), the sidebar and the "Guild Home | Guild Help | My Guild" nav.
The last line is a template for moving the guild stats around. Add your prefered margin values to move the stats to the right, left, up or down.
Move Guild Stats
added Dec 13, 2012
Back when I used to make guild layouts on a regular basis, I had this bit of "reset code" I used every time (I've posted it here in case you want to use it). It included code to remove the background, header, footer, sidebar, guild logo, guild neighbourhood and that irritating "Guild Home | Guild Help | My Guild" nav; move the guild stats off to the side; and some guild links that were always present on my guild homepage.
So when someone came to me and said their stats-moving code wasn't working in IE, I was confounded. Mine had always worked, but I couldn't remember what I did to make it that way since I always copied and pasted. Now that I've done some testing and I'm certain this works in IE, here's how to move your guild sidebar anywhere on the page without bugs in IE:
1. Don't change the width of #main or #content. It's common to do so, but that's the reason the bug happens in IE. You can get the result you want (most likely) without adjusting this property. Instead, use display: none; to hide the elements you'd ordinarily cut out with the adjusted width and set background: none; on all elements showing unwanted backgrounds.
2. Reset #main with the following code: #main { width: 100%; border: 0; margin: 0; padding: 0; }. This will allow you to position your guild stats from the very top left corner of your browser instead of a random place in the middle of the page.
3. Set the margins on #content to whatever values you'd use if you were positioning this. (Say, margin-top: 20px; margin-left: 800px;)
If anyone knows what causes this bug or a better way of doing this, please contact me!
Hex Code Shorthand
added Dec 12, 2012
I set out to write about this the other day, and ended up with this instead, but it's an important issue and I feel the need to come back to it.
Did you know you can shorten CSS/HTML hex colour codes to 3 digits instead of 6? The only catch is that the first and second digits are the same, the third and fourth digits are the same, and the fifth and sixth digits are the same. Basically, it has to follow a pattern:
#xxyyzz
You can then shorten that to
#xyz
Some examples:
#FFFFFF → #FFF
#000066 → #006
#DD5511 → #D51
(These are similar to the web safe colours I talked about in my infographic, but you can use any number or letter from A-F, not just the 5 cases I mentioned there.)
This is great if you need to hammer out some code really quick, but don't use this for your final product; always expand them to 6 digits whenever possible. The reason is that IE doesn't recognize 3-digit hex codes (not even IE9), and will simply display white or whatever default is set. This also applies to every other instance you can use hex codes, like in Neoboard fonts or guild preset colour schemes.
So if you just learned about these 3-digit beasts, don't get too excited. If you've been using them regularly, curb that habit fast!
Loosely
added Dec 10, 2012
Read my note about templates before continuing. (It's for your own good.)
This template is meant for sites with lots of content that want the typical banner + sidebar + content formula with a few extras. It includes a horizontal navigation, footer, two feature boxes and an optional feature area in the banner. The code is easily customizable: Flip the sidebar to the left or right, take out or put in the banner feature, make the top nav and footer full-width or included in the wrapper. Essentially, there's just one version of this code, but I've modified it slightly into a second variation (I may have changed two lines of CSS) just to give you an idea of what's possible.
If you have any questions, find any problems with the template or have suggestions to make the code more efficient/less confusing, please contact me!
BETA TESTING Loosely is brand new code available for your use. Because of this, I'd really appreciate it if you test them out for me: Try to use them. If you break it somehow, let me know. If something was really confusing, let me know. If none of it makes sense to you at all, let me know. That way I can improve the code (if necessary), and more importantly, improve the instructions that come with the code. Once I'm confident that these templates are going to be useable for intermediate coders, this message will come down, but I'd still love to hear any suggestions or (try to) fix any issues.
version 1

This is a standard wide layout with a banner, top (fixed) horizontal navigation, a footer, and featured content in the banner area. |
version 2

This version shows the banner and footer inside the wrapper and eliminates the featured content in the banner area. It's also narrower, which is super easy to change! |
Hex Color Codes
added Dec 6, 2012
This tip was inspired by an IE bug (which I never got around to addressing in this tip, ironically, but is covered here), then turned into a Photoshop experiment, and grew into this... masterpiece. At any rate, enjoy. (Give it a second to load.)
Poll: Do you visit Neopets on your phone/iPod/other mobile device?
results compiled Dec 6, 2012

Random Observations
- Most people who offered responses about what they do while on their phones said they do the dailies they just can't miss or use the boards.
- Most people who did say they use their phones said they only use them when they don't have a computer or when they're too lazy to get to their computer.
Results were collected from November 28, 2012 to December 6, 2012 through neomail and Neoboards on the HC, GC and PC. Got suggestions for improving my methods?
Pop-Ups On Hover
added Nov 27, 2012
The title is slightly misleading, but I couldn't think of a better way to separate this concept from general hover effects you'd see on links. Here's what I'm talking about:
Keep in mind as you're reading this, though, that once you've got the basic concept down, there is so much that you can do with this idea. Here's my word of caution, front and center, though: Don't use this for the sake of using it. Rein yourself in and only use hover pop-ups (or whatever you come up with) when it actually fits your content and purpose of your page. So unless the purpose of your page is to wow people with your coding prowess, don't use this just because you know how. (And that's the end of my mini-rant.)
First a little theory/disclaimer/more talk before the tutorial gets started. Remember the IE hover issue? :hover only works (in IE) on a elements (ie. links). We can get around this by wrapping our code in a link, but that causes another issue: it's impossible to put links within the content of your pop-up (because you're never ever ever allowed to have a link within a link). Therefore, this tutorial assumes that:
- you want this effect to work in IE as well as every useful, modern, hip browser.
- you don't have any other links in the pop-up content.
Actually moving on now!
HTML
To begin, we'll get our HTML in place. (I'm sensing a pattern in my tutorials, are you?) We need two things: something to appear on hover, and something to hover over. In theory, these things could be almost anything, but for this tutorial, we're going to use a link and a span:
What you need to take from this section is that the pop-up needs to be inside the thing we're hovering over. The link goes nowhere; it's just a vehicle for our pop-up. I've filled the pop-up with Latin fluff, but you could put images, text, or whatever you want except links.
Styles
Let's put some basic styling on there so that it's not default. None of the following has any bearing on the pop-up functionality, so if you feel like leaving this out, please do!
Here's the real styling, the stuff that makes it work:
This tells the page to hide the popup until you need it. Now you add the following to tell the page to display the popup span when the user hovers over it:
This works because you're specifying .popup only when the link is being hovered over (a.hoverhere:hover).
If you leave it this way, your popup is going to move the rest of your content when it appears, and that's usually not what you want. So we'll add positioning to take it out of the flow of content:
In your HTML, you need to add the position declarations:
The position: relative; on the link is there so that the span is positioned relative to the link instead of the entire page. In this case, it'll be flush left with the link and 15 pixels down. You can change those numbers to whatever works for your content.
And that's it!
Easy as pie, right? As always, if you have suggestions or comments or questions, please send them to me! If I get a lot of suggestions for how to do this differently, I might start another post with a list! On top of that, if you have ideas for how you can use this, I'll make a list of those too!
IE And Hover Effects
added Nov 27, 2012
After mentioning this in so many articles and tutorials and conversations, I decided to actually lay this out in case someone wasn't aware.
IE only acknowledges hover effects on a elements.* That means that if you have
li:hover { background: green; }
somewhere in your code, IE will completely ignore this. If an IE user hovers over that li, they simply won't see the background change to green.
You can wrap almost anything you want inside an a tag and put the hover effects on the a:hover so that they work in IE, such as this:
a:hover li { background: green; }
There are two points to be aware of when you do this:
- Wrapping something in an a tag means that you can't have any other a tag inside it, which means no links!
- This may create invalid code. The example above is actually invalid because you're not supposed to have a block-level element within an inline element. (See definitions for block-level and inline.) Some browsers may behave strangely in these cases.
If this won't work for you, you can simply leave IE users out. I don't object to this so long as it's not necessary to the experience of your page. If no hover effects means no content, that's probably a bad thing for your users.
*Exception: IE9 finally respects the :hover pseudo-class on non-link elements in strict mode. This means IE9+ will show all your fancy hover effects on everything except petpages, which always display in quirks mode. (An explanation of quirks mode and what triggers it can be found in this article.)
CSS3 Properties
added Nov 11, 2012 | updated Nov 27, 2012
There are a few "new" CSS3 properties that are actually really interesting to use and play with, especially on Neo. (The trick is not to use them for the sake of using them.) That said, a lot of them don't work in certain situations, so I figured I'd go over a few of them here.
A few notes: So far all of these properties only work on guilds and petlookups, but not petpages or userlookups, and then, only in inline styles (with one exception). (That means I can't demonstrate any live effects for you. Sorry!) Some browser versions don't support these properties at all. Other browsers may require vendor-specific prefixes (such as -moz- or -webkit-) to work, and I've included that in the notes for each property.
transition
transition is meant to be used when working with hover effects. With it, you can smoothly transition from one state to the next. (Imagine a background colour gradually fading from grey to purple.) Here's how you use it:
![]()
You'll notice that I've got multiple values in there. That's because transition is actually short-form for transition-property, transition-duration, transition-timing-function and transition-delay. I won't go over the last two because you'd probably only need them for very specific cases.
transition-property is the property (or properties) that you want to be animated. In my example, I've used background, but you can also use the keyword all to have all changeable properties animate on hover. (This is the default.) If you want to list more than one property, separate them with commas, like this: transition-property: background, opacity;
transition-duration is how long the animation should last. (The s stands for seconds. Remember to include it!)
Here's the tricky part. Because this property is still sort of new, most browsers require a specific "vendor prefix" to make it work. Currently, Chrome, Firefox 16+, IE10 and Opera 12.1+ accept transition as it is. (IE9 and below do not support this property at all.) To make it work in Safari, Firefox 15 and under, and Opera 12.0 and under, you need to add the following properties as well: -webkit-transition, -moz-transition, -o-transition. That means your code will look like this:

(If you don't have any Opera viewers, feel free to leave that last one out for the sake of saving precious characters!)
** Actually, transition is the one exception to the inline-styles rule. On guild layouts you can use this in your regular stylesheets, but on userlookups, you still have to put the CSS within the tags like above.
border-radius
border-radius will give a box rounded corners. That's pretty nifty! It's also a short-form, and it follows a similar pattern to margin and padding short-form. (That means you can put all four corners into one declaration and use the order top-left top-right bottom-right bottom-left.) You can use it like this:
![]()
In the past, you needed to use "vendor prefixes" to make it work in all browsers, but newer versions of Chrome (5.0+), Firefox (4.0+), Safari (5.0+), Opera (10.5+) and even IE (9+) all accept border-radius just as it is.
(You can also do some funky elliptical borders too by adding in extra properties, but I'll let you do your own research for the sake of brevity.)
box-shadow
box-shadow will create a drop-shadow on any non-text element that you want. It's a pretty awesome alternative to fixed-size image backgrounds, but it's unfortunate that it's so poorly supported on Neo. At any rate, in the hope that it will eventually be allowed on all pages, here's how it works:
You can use up to five values in this one declaration: right offset, bottom offset, blur, spread and colour. Separate them all with spaces. The spread value is optional, but I wouldn't recommend skipping any of the others.
Here's an example:
box-shadow: 10px 5px 0 0 #333;
That'll give my element a harsh, border-like shadow 10 pixels to the right and 5 pixels to the bottom with a dark grey colour. If you give either of the offsets negative values, they'll move in the opposite direction. For example:
box-shadow: -10px -5px 0 #333;
That'll make the shadow appear to 10 pixels to the left and 5 pixels to the top of the element.
Remember to put your box-shadow declarations in inline styles, like so:
![]()
Browser support is fairly similar to that of border-radius; the latest versions of all browsers (even IE9+) accept box-shadow as is. To support a few unfortunate Safari users, you'll have to stick a -webkit- prefix on the front, which makes your final code something similar to this:
![]()
If you don't feel like catering to those users, however, save yourself the character space!
And that's it! Do you have any other exciting CSS3 properties you'd like me to test and add to this list? Have you tested any of the ones I've written about and found that they don't behave as you expected? Let me know!
A big thank you to zfernbaugh for pointing out that newer versions of Firefox accept the transition property without prefixes!
Top Troubleshooting Tips
added Nov 4, 2012
Sometimes it's hard to figure out why your page suddenly broke. All you see is a mess, and you're not sure where it came from. Here are some things I do to find solutions to my coding problems (in this order):
1. Validate your code. (Search "CSS/HTML validator".) This can catch missing end tags, incorrectly spelled attributes/tags, etc. If it comes up with errors (besides doctype issues), fix them and try again. Important things to note:
- Copy and paste ONLY what you're putting into Neo, not any native Neopets code. (You can't fix TNT's coding errors for them, so don't bother.)
- Your Neopets code will never fully validate. First off, you'll be missing a doctype, and it'll scold you for that. (If you select one from the dropdown, remember that all pages except petpages use XHTML Transitional. Petpages do not declare a doctype, so the point on that front is moot.)
2. If validation doesn't reveal problems in your code, try to go back to a working version. This is where saving copies of pages is handy; before you start tinkering, save a copy of your working page in case something goes wrong.
3. If you didn't save a copy (I'm always guilty), comment out code until it starts working again. Don't go randomly adding comments, though. I always comment out everything and uncomment lines one-by-one until it breaks. (Remember that you can't comment out code on Neo, so you'll have to do this on your local copy.)
4. Once you find the troublesome code, search for a solution.
That's all I have for you so far! Do you have a handy troubleshooting tip that others could benefit from reading? Send it in!
Tooltips On Images
added Oct 30, 2012
You know what a tooltip is, right? It's one of those things that pop up occasionally when you hover over an image, giving you a description of what it is. Something like this:
![]()
You can put these on your images by adding a title attribute. (If no title is present, IE will display the alt attribute as a tooltip, so be careful what you put in there!) Your image tag will look like this:
So far I haven't found a limit on the characters you can put in in your title attribute. (Keep it brief as a rule of thumb, though.) Be careful, however, of which characters you put in there, as using quote marks (" or ') may cause some issues.
The Difference Between visibility And display
added Oct 23, 2012 | updated Nov 11, 2012
display and visibility are two entirely different properties, though the declarations display: none; and visibility: hidden; sometimes get treated as interchangeable. They're not the same thing, though. Here's the deal:
display determines how the browser should handle the space that the element takes up, so display: none; tells the browser to pretend that the element doesn't exist. It doesn't take up any space, it's not even there.
On the other hand, visibility tells the browser how to treat the opacity of an element, so visibility: hidden; tells the browser to pretend that the element is invisible. It still takes up space in your layout. You can definitely use this to your advantage!
On Neopets, these are most often seen in removal codes. Next time you use one, just be aware of the differences between them!
PNGs vs. JPEGs
added Oct 23, 2012
Optimizing images for the web is a big deal, but making them look pretty is just as important. Do you know whether to use .png for an image and when to use .jpg? Here's what most designers will tell you:
Use .jpg for photos, or images with photo-like qualities. Lots of detail, usually not vector images.
Use .png for things like backgrounds, logos, screenshots and other images, providing they aren't photos.
Personally, I use whatever will give me the smallest filesize without sacrificing image quality. (If you're a Photoshop user, using the "Save for Web & Devices" tool will give you all sorts of options and previews!)
Got some advice on images? Share it with us!
Removing The "Neopets Bar" From Petpages
added Oct 18, 2012 | updated Oct 22, 2012
I've always just assumed every Neopets coder knows how to get rid of that puke-coloured bar from the top of their petpages, but I've come across a bunch of people recently who've never used a reliable removal code, despite the fact that it's so easy!
EDIT: Another super easy method (brought to my attention by Moose, thank you!), is to simply add
body { margin-top: -14px; }
to your styles. This works best for layouts that rely on positioning, but be careful with layouts that don't. For those, you might have to account for the extra 14 pixels somewhere in your code. If this definitely won't work for you, try the following removal codes.
The "bar" doesn't have a class or ID we can style, but it is contained in a table, which makes it a little more unique. You can remove it simply by using a code similar to this:
table { display: none; }
Here's the thing, though: If you want to use tables somewhere in your content, you've just hidden all of those, too. You can show them again, though, by using this right after the line above:
#wrapper table { display: inline; }
Remember to change #wrapper to whatever your containing div is. If you don't have an umbrella div containing all of your content, you might have to give every table a class and do this:
table.showme { display: inline; }
Note that I used display: inline; instead of display: block; Tables technically aren't block-level elements, and telling them to be will give you some weird results. Even so, your tables may behave unpredictably in Firefox. (Because FF expects tables to have a display value of table but other browsers don't recognize this value.) If you're relying on the valign attribute (which won't work in FF with the display: inline; declaration), you may want to use code similar to this:
table { visibility: hidden; }
#wrapper table { visibility: visible; }
Because of the way visibility works, this will leave a 14px space at the top of your page. If there's nothing there, you (and your viewers) won't notice it. Otherwise, account for it with negative margins or absolute positioning.
Having issues with this? Got something to add? Contact me!
Learn To Search
added Oct 16, 2012
The heading on my page lied to you. I admit it. Double Standard might be helpful to you (I hope it's helpful to you, otherwise... why are you here?!), but a search engine is your real best friend. I'm willing to help out as much as possible, but there are times when it's not feasible to sit around and wait for me to deal with your problem personally. That's when you have to take action and figure it out yourself — with a little help from the world's biggest search engine. Here are some tips:
Tell the search engine what your problem is. Are you trying to find an HTML-only slideshow? Are divs hidden when they shouldn't be? Is your absolute positioning not behaving like you expect?
Be specific.Thingy" isn't going to get you anywhere. "CSS opacity not working in IE" might get you a few more results.
Try to diagnose before you start searching. If everything worked great before you added the margins, there's a good chance it's the margins that messed it up. In that case, your search should mention something about "CSS margins".
Use keywords. Include CSS properties that might be causing the problem, the HTML tags involved, and — if your issue is in one specific browser — the browser you're using.
Read a little, try again, repeat. If your first search pulls up pages that don't answer your question, they still may hold hints for you. Take those and rephrase your search. It might take you awhile — some searches take me hours — but you can uncover a lot if you're persistent.
As with most things, knowing exactly what to search for requires that you have an idea of where the problem stems from. So if you're very lost and searching isn't working its magic for you, it's still wise to ask for help.
Building A Rock-Solid Paged Layout
added Oct 12, 2012
Also known as an anchored layout, a paged layout is simply an illusion of multiple pages within one page. This is super handy for situations where you'd like to break up your content but would prefer not to spread it out over multiple petpages. (And for the record, this concept can also be applied to userlookups and guild layouts, with a little more effort and slightly different application.)
Here's how it works: Your page has a container element (let's go with a div with the id "container") which holds several "section" elements (hmm... how about divs each with a class of "section"?!). The container div acts like a window to the section divs behind it. Imagine that the section divs are on their own layer that scrolls behind the container div opening.

Normally the section divs would scroll freely, but you're going to restrict that by giving the container div (and the section divs) a fixed width and height and adjusting the overflow CSS property. This way, when people first view your page, they only see one section, and you have to give them links to view the rest of the sections. Viewers see one section at a time, which creates the illusion we're going for.
I'll take you through a tutorial now that will help you create a rock-solid, cross-browser compatible, easy-to-modify layout. If you're smart, you'll save this template somewhere so that you can reuse it later!
First, our HTML structure.
Easy so far, right? Next, we put in sections for our content inside the container div. (In the following bits of code, I'm going to leave out parts of the HTML. I've included enough to give you some context, though, so hopefully that helps! Just don't add in another
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
If you'd like to become an affiliate, please contact me!
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
If you're listing me and would like a link back, please contact me!
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The above are sites that have featured or reviewed me! Thank you! (Hover for details.)
I really appreciate any constructive feedback you can give me; it's a big help when I decide what to work on and how to move forward.
If you have general comments or questions about the site, simply neomail me, preferably with a subject line like "2xS" or "Double Standard." (Keep in mind that I check fadeshear more than asparearie.) Alternatively, if I have an advertising board up, feel free to post it there.
More importantly, requests: If you'd like me to discuss a particular topic, neomail me with as many details as you can muster. It helps to know where you're coming from. If you have an idea for a template, tell me your thoughts, but know that I prefer to do templates that serve a specific purpose (like displaying your avatar wishlist), rather than generic premades. You could also post on my board, if I have one running, but I'll probably also ask you to neomail me anyway so I don't forget.
And this is the best offer I have: If you're having coding problems with something on Neo, neomail me and I can try to help you! I can't guarantee that I'll have the time or energy to answer you, but I will do my best to answer as many questions as possible. This works out for everyone because if I learn something new, I can share it with everyone else!
Hopefully this way, Double Standard will become more of a conversation — a community — rather than a wall of text on a petpage.

(Counter started September 7, 2012)














































