If you want to preserve whitespace within an HTML element (div/span) without using non-breaking spaces (and therefore breaking word-wrap), add the following property to the CSS style(s) for that element:
There are more options available for this property as well:
The mistaken belief that GIF has a limit of 256 colors probably comes from the way GIF was first used when it came out. In the late 1980’s, PC video cards generally supported no more than 256 colors. Image exchanges were becoming popular among BBS systems and the Internet and viewer programs were quickly produced. No one tried or needed to generate images with more than 256 colors since they could not be viewed on anything less than high priced graphics workstations. Programs that converted images to GIF worked up a number of methods to reduce the number of colors to 256 or fewer. Some actually did a very good job. GIF files were constructed with just a single image block, even though the GIF standard placed no limit on the number of blocks. Since there was no use for more than 256 colors, there was no use for more than one image block. This practice became effectively ingrained into the computer culture and eventually everyone “knew” that GIF supported no more than 256 colors. The fact is, the programs that generated GIF files supported no more than one image block, and thus didn’t have a means to deal with more than 256 colors. The top image shows that a GIF file really can have more than 256 colors.
Examine the test images in the left column below. To determine how your browser handles PNG transparency, find the images on the right that look the most similar.
Not all possible results are shown; there are too many combinations of background colors and shapes of the opaque region. However, I intend to include every result that actually occurs in a mainstream browser. If I am missing any, please let me know.
It’s come to my attention that my images which show how alpha transparency should look are not quite perfect in regard to precisely how transparent they are at various points. Rather than try to modify this page to test gamma correction issues as well, I’ve created a separate test page for that.
This test page was constructed by Jason Summers. Comments may be emailed to firstname.lastname@example.org.
There are other test pages listed at the PNG web site.
(via PNG transparency test)