Bonsai Sky: Working around browser limitations with creative imagery and code
Mike Davidson, Designerwww.csszengarden.com/069[View full size image]

Versioning
Some of the interesting imagery within Bonsai Sky is viewable only in certain browsers; because of Davidson's use of specialized CSS properties it simply wasn't possible to present an identical version of the design to everyone. Instead of giving up on the visual effects he wanted to add, Davidson effectively fooled the browsers that would apply them improperly by turning to some selective CSS.
Black Border Positioning
Bonsai Sky is framed with a thick black border that makes use of fixed positioning:
The fixed positioning attribute allows elements to be placed precisely within a layout and remain in that spot even when the user scrolls down the page. The fixed elements appear to float above the rest of the page, just as the borders seem to do in this design (FIGURES 1-3).
#extraDiv2 {
background-image: url(edge_bottom_black.gif);
background-repeat: repeat-x;
position: fixed;
bottom: 0;
left: 100%;
width: 100%;
height: 20px;
margin-left: -100%;
}
Figure 1-3. The frame stays put as Bonsai Sky scrolls.
[View full size image]

Black Border Workaround
However, Bonsai Sky's borders would obscure the content if this were allowed, as shown in FIGURES 4-6, so a workaround was vital. Various filters exist to hide CSS from browsers, but instead of turning off the borders completely, Davidson found a way to hide them just offscreen by exploiting an unrelated deficiency of certain browsers.
Figure 4-6. The frame overlaps if allowed to scroll.
[View full size image]

Since most advanced browsers support negative margins the borders will be properly rendered in the spot Davidson intended. The browsers that don't support negative margins will not move the borders back onscreen, leaving them nicely hidden. Luckily for Bonsai Sky, these same browsers lack support for fixed positioning.
#extraDiv2 {
background-image: url(edge_bottom_black.gif);
background-repeat: repeat-x;
position: fixed;
bottom: 0;
left: 100%;
width: 100%;
height: 20px;
margin-left: -100%;
}
Buddha
After working out the placement of the borders, Davidson threw in an extra visual accent to complete the theme. A small gold statue of Buddha sits on a floating stone ledge, just touching the right edge of the browser window. The statue image was placed using the same fixed positioning technique used for the border.Since that meant that Internet Explorer for Windows wouldn't render it anyway, Davidson decided to take advantage of the alpha transparency possible with the PNG file format, which it doesn't support either.A faint, transparent shadow was placed behind the ledge within the PNG file (FIGURE 7). As the user scrolls down Bonsai Sky, the shadow prevents the rocks of the ledge from disappearing into the rocks in the background, and maintains a sense of layered three-dimensionality.
Figure 7. A faint shadow appears behind the ledge and the statue of Buddha, thanks to PNG transparency.

Sidebar Transparency
After setting the text and positioning the cliff photo, Davidson faced a dilemma: The link lists"select a design," "archives," and "resources"required placement. But after spending time crafting the cliff imagery, he was hesitant to cover it up.A slightly transparent overlay seemed like a good solution, but PNG transparency obviously wasn't going to suit the bill; this time it was important for the imagery to be visible in Internet Explorer for Windows. So instead he turned to an age-old Web designer's trick of fooling the eye into seeing a small, transparent GIF as a half-opaque overlay.A checkerboard pattern of alternating black and transparent pixels appears to be a 50% black transparent area, when repeated across a larger area (FIGURE 8). This is very similar to how inkjet printers simulate gray by using a screen of minuscule black dots to fool the eye into seeing something halfway between white and black.
Figure 8. Enlarged transparent checkerboard GIF pattern that simulates a 50%-black transparency.

Figure 9. Checkered GIF overlay, 100%.

Special Treats
The fixed positioning tricks Davidson used almost ensure that the viewer spends extra time scrolling the page to see them in action. Once a viewer notices the statue of Buddha floating above the background cliff, his or her impulse is to follow it up and down the page.As a reward for making it all the way down to the bottom, the viewer gets a nice bonus: runes of the major browsers that appear to be carved into the face of the cliff, topped with some CSS code (FIGURE 10).
Figure 10. Browser icons as runes carved into the side of the cliff.

Judgment Calls
While there is no use in applying fancy CSS effects if the majority of your users won't be able to view them, the ability to selectively degrade a design and provide browsers with graceful alternatives is an important method of experimentation.Pushing the limits of implementing CSS effects requires that designers take some chances, but fortunately it's entirely possible to play it safe at the same time so that viewers are not left disappointed. Discretion and careful attention to browser support ensure the richest possible experience for a wide variety of users, without leaving anyone too far behind.