|
||||
Webmaster Bag of TricksThe 1 pixel Transparent GIFWebmasters often need to control spacing on a page in absolute pixel dimensions. Using GoLive's "grid" can provide this, but has many disadvantages. A tiny one pixel wide by one pixel tall GIF that is transparent can be placed on a page and stretched to any size. GIF is a very efficient image format for limited color images, so a 1 pixel by 1 pixel transparent GIF can be as small as 43 bytes. This downloads almost instantly, and because the browser will cache an image and reuse it, the browser only downloads it once, no matter how many times you use it on a page or a site.Where to get one? Well, you can make one or you can download one here. To make one is fairly simple in most image editor programs. Here are the steps using Adobe Photoshop:
That's it, you now have a 1 pixel by 1 pixel transparent GIF image to use as a spacer anywhere in your site. Note: If you have a different image editor, you probably won't have the Save For Web option. Be sure to save the image in GIF89 format, with transparency enabled. You may have to select a background color as the transparency color. Using the 1 pixel transparent GIF:Simply place an image in a cell of the table (or anywhere on your page) and browse to your "spacer.gif" image (or whatever you called it). Then set the width and height to the size of space you need. It is best to do this as soon as you place the image. Otherwise you might have trouble finding it on the page to click on since it is so small. Unless it really needs to be 1 pixels square, it is usually best to set it with a larger height and width so you can click on it later. For example, when I need a 1 pixel wide row, I make the image be 1 pixel by 15 pixels so there is something to click on later.Some typical uses for a 1 pixel transparent GIF:
Download a transparent GIF here.
|
||||