Spacer GIF

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Prior to the widespread adoption of Cascading Style Sheets (CSS), the spacer GIF was a transparent image, often used to control blank space within a web page, that can be resized according to the HTML attributes it is given. The reason a spacer GIF is invisible is so that an HTML developer can create a table cell and fill the background with a specific color that can be viewed through the transparent spacer GIF. For instance, a developer seeking to create a square blue box 500 pixels on a side could use a separate blue 500×500 graphic at the expense of additional bandwidth. Instead, the developer can specify the table cell background color and specify the dimensions of a pre-existing transparent spacer GIF.


David Siegel's 1996 book Creating Killer Web Sites [1] was allegedly the first to publish the Spacer GIF technique. According to Siegel, he invented the trick in his living room.[1]

The Cascading Style Sheets (CSS) standard has diminished the use of spacer GIFs for laying out web pages. CSS can achieve the same effects in a number of ways, such as by changing the margin or padding on a given element or by explicitly setting a relative position. If used properly, CSS reduces unnecessary code in a web page. Blank 1×1 GIFs are still occasionally used to fix a PNG rendering limitation in Microsoft Internet Explorer versions 5.5 – 6[citation needed].


  1. ^ Justaddwater (2006-03-03). "Justaddwater: Who invented the Spacer GIF". Justaddwater. Retrieved 2006-11-26. 

External links[edit]