tomhoppe.com

Archive for April, 2009

CSS icons next to links, spanning multiple lines, and IE support

Thursday, April 16th, 2009

Man, IE sucks. We deal with it every day, but the lack of support for standards really makes developers jump through hoops sometimes for stupid little things. At work we’re adding some icons next to links to better identify them. A slideshow, community links, video etc etc. Normally this would be really simple. Something nice and automated like the CSS guy outlined would be nice. Except……

If the link spans two lines, IE just freaks. It doesn’t recognize the fact that the a element is two lines, it now thinks its a huge a element so the icon gets all cut off and wierd looking. Also, :after CSS support in IE doesn’t work, so it takes that option off the table.

So having said all that, we settled for a solution where we drop a tag, I chose the <i> tag for “icon” (I liked it better and its shorter then using the span tag and I use <em> for italics) after the end of the text inside the a element, and then identify the type of link with a class on the a tag. Not the ideal solution as now this isn’t automated and we have to manually identify the links, but to me it seems to be the only solution that reliably works in all browsers (IE6, IE7, FF, Safari). Alternatively, for automation, all it would take is a little jQuery to go through the hrefs on the page and drop in the <i></i> tag and class on the <a> tag.

<style type="text/css">
.asdf i {
background:url('url of your image') no-repeat;
height:10px;
vertical-align:top;
width:10px;
}
</style>

<a class="asdf" href="yourlink">Your link text goes here<i></i></a>

What a difference some RAM makes

Friday, April 3rd, 2009

I’ve been running the Windows 7 Beta the last month or so. Started out with build 7000, which was pretty good, and now build 7057 I think. The latter one is pretty good, but in the last few days my computer has had horrid stability issues. It would just hang every few mins. It didn’t seem like a “software” hang, as everything would absolutely freeze, and if it froze in the middle of playing a racing game, the sound would also hang. I’m on 3GB of RAM, 2GB of matched pair, and a 1GB stick that I got from somewhere I don’t remember. I took the 1GB of RAM out thinking, hey, worth a shot as the first line of troubleshooting. Halfway surprisingly, it fixed my problem, but DAMN my computer is a dog now. Windows 7 itself seems a bit slower, I guess it really liked that extra 1GB. Also, surprisingly, the racing game pretty much went to shit. I was getting great 60fps at 1280×1024 resolution, but with only removing 1GB of RAM, its struggling at 1024×768. Wierd. Had no idea only 1GB of RAM could have that big of a difference on system speed.

Guess its time to pull the trigger on 4GB of faster RAM. Its cheap now anyways :)