Add CSS Text Shadows for Cleaner Text
It's no secret: applying text shadows on the Web has never been easier. Well, at least if you're using Safari, Opera 9.5, or Firefox 3.1a. By adding just a single piece of code to your stylesheet, you can get crisper text. Here's the CSS you'll need:body {
text-shadow: 0 0 0 #000;
}
The text-shadow CSS fix in action shows the before (left) and after (right) in Safari 3.x when applying the single piece of CSS. See the improved rendering?
But what about users of older browsers? For some, there is hope. With Firefox 2, there is a small CSS hack that allows the fonts to be rendered in relatively the same manor. Here's the CSS:
body {
opacity: : .99;
}
Better Image Scaling in Internet Explorer
Image scaling via CSS and inline HTML is no big deal, but it has never worked well in Internet Explorer—go figure, right? Well, the creative minds behind Flickr have found two ways to help out IE6 and IE7 improve image scaling. It turns out that the same method of scaling images—something called bicubic resampling—is present in all modern browsers, but it's disabled in IE7. See the difference?
Before and after using enabling the resampling. (Image credit Joel Spolsky)
You can enable it in IE7 with a bit of CSS:
img {
-ms-interpolation-mode: bicubic;
}
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src='/path/to/image.jpg', sizingMethod='scale');
Bring Up the Rear: Turn IE5/6 into IE7
What's that mean exactly? It means that, with a little Javascript, you can render CSS in IE5 (on Windows) and IE6 just like IE7. Thanks to Javascript guru Dean Edwards, we now have a script that makes our least favorite browsers render CSS more accurately. As a bonus, it also makes transparent PNGs work! With this fix, aside from some extra Javascript, there's no real disadvantage. You'll save development time by not having to address the box model issues, by using more pseudo selectors, and more—all without having to overhaul your website's structure. With Javascript market saturation likely above at least 95%, you don't have much to lose (save a little time learning the ropes).Developing solid interactive experiences cross-browser has *always* been an issue. As long as browsers continue to interpret HTML and CSS in different ways, we'll have these issues to deal with. With browsers no longer under development, like IE5 and IE6, we can take some of the problems out of the picture. These issues might seem superficial, but **it's the details that make for grand experiences online**. Take the extra time to use these simple cross-browser techniques to make your website look and behave it's best. Enjoy!