CyberD.org
C:\ Home » Archive for "Code" (?) (Page 5)

An iFrame Con = Not A Con

If you have a navigation frame loading different pages into a "main frame," it is hard to create a navigation bar that tells users which page they are on (because the other frame loads the new page without telling the navigation bar).

But it's not, is it? Isn't the active attribute of CSS perfectly suited for such a navigation bar? After you click it, and the new page loads, it will stay highlighted, just as a normal menu should. Only you won't need to use a server-side scripting language such as PHP just to learn which page the user is on so you can highlight that one page. It'll actually save a lot of bandwidth in not needing to reload the menu or process scripts on every page to check which page it is. Just saying...

502 Gateway Error

So I opened my site yesterday night. Shock. 502 error. I tried all of my sites, and my sister's site (that I'm currently hosting on the same server) and all of them displayed the same message.

502 - Bad Gateway
ngix version ???

I wasn't shocked, but it was rather inconvenient because I was in the middle of posting my resolutions post for the year. The reason I wasn't shocked was because I've had the same error before, and it resolved itself. That time, I just logged in through FTP to check that the sever wasn't really down or something (it wasn't), refreshed the sites, and it worked again! This time around I tried reloading pages for about 15 minutes before I gave up and went to bed, thinking that the site should be back up and running in the morning. It was.

Still, I'd rather this didn't happen. Since I'm on a Shared server I don't have much control over the server settings myself, so I can't perform any of the many tweaks that users around the net have found to resolve this error. What can I do? Contact the host, obviously. Let's see what they have to say about this...

UPD: Problem solved, I think, see this post.

I Decided To Skip The CSS Reset

CSS Resets have been growing in popularity over the years, until it's become such a standard that many tutorials guiding you through the basics of CSS even advice you to include a CSS Reset, before you do anything else! No doubt it can be useful to bridge the differences in the way browsers display different elements, but at the same time there are a few cons to this useful technique.

The big one, is that every element added to your stylesheet is a request to the browser. The more styles you include, the heavier your site will be to load. Not like it will be a noticable difference for most sites; especially not if you're using a modern computer and browser, but in the service of tweaking webpages as much as possible, styles that aren't necessary to add shouldn't be added. For example, I never use the <cite> tag, so there's no reason why I should include it in my stylesheet.

The CSS Reset I used last year had a lot of unnecessary elements in it, and a lot of necessary ones, too. When I implemented it some of the elements I had styled myself suddenly looked a bit messed up due to browser-defined margins and paddings and other things suddenly receiving a null value, so I had to redo quite a bit of code with the new values in mind. But considering I'm getting a display standard not based on a specific browser, it was worth the time it took to change.

But a CSS Reset won't fix everything. I realized while going through my stylesheet that everything I'd like to tweak doesn't need a Reset. The Reset is for the most part just a duplicate value of something I'm styling myself, and the browser doesn't interfere as much as you'd think. Since IE implemented the quotation marks for <q> tags, there aren't so many noticeable differences between them either.

It might require me to check the site on different browsers once in a while and look for bugs, but otherwise, the switch will make things both easier and faster. So, I'm skipping the reset this time around.

No Hover On Visisted Links!

I stumbled upon a noobish problem today. While messing around with the site CSS I decided to add values for visited and active links, and I added them after the values for link and hover. That's a no go! As it turns out, the visited link color will be applied to both visited links as they are, and to visited links when you try to hover over them. The correct order or link values is this (along with a sneakpeak snippet of next years theme):

a{
	color:#09C;
	text-decoration:none;
	}

a:visited{
	color:#069;
	text-decoration:none;
	}

a:hover{
	color:#F60;
	text-decoration:none;
	}

a:active{
	color:#F30;
	text-decoration:underline;
	}

It's worth a post! :)

How To Test A Theme Before Making It Public

Use this. I'mma get to work on the 2013 version right about now, but this time, you won't see it before it's done. ;)

Testing Compression Time

If you want to zip with 7... get a fast computer. :)

Testing Compression Time

Privacy   Copyright   Sitemap   Statistics   RSS Feed   Valid XHTML   Valid CSS   Standards

© CyberD.org 2025
Keeping the world since 2004.