Spacer Gif

A spacer GIF is a small, transparent GIF image that is used in web design and HTML coding.

They were used to control the visual layout of HTML elements on a web page, at a time when the HTML standard alone did not allow this. They became mostly obsolete after the browser wars-fueled addition of layout attributes to HTML 2.0 table tags, and were mostly unused by the time Cascading Style Sheets became widely adopted.

History

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

The Cascading Style Sheets (CSS) standard 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.

Usage

It was recognised early on that although the size of table cells could not be set directly, each cell could contain an image through an IMG tag. The size of image tags could be set independently, with their WIDTH and HEIGHT attributes. The table cell would then resize itself automatically to just contain this image. It was also realized that the displayed size was controlled entirely by the attributes and was independent of the actual size of the image file used (although a real image file was still needed). Accordingly, the same image file could be used for all the many spacer images needed on a web page. The only requirement was that this image was invisible, either by being the same color as the page, or by being transparent.

Spacer GIFs themselves were small transparent image files. GIF files were used as it was a common format that supported transparency, unlike JPEG. These files were commonly named spacer.gif, transparent.gif or 1x1.gif. Prior to the widespread adoption of Cascading Style Sheets (CSS), the spacer GIFs were 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.

Drawbacks

Designs produced often looked perfect on the designer's display, but could look entirely different on the reader's display. Different screen resolution, browser rendering engines, as well as user font preferences, could change the layout of the design considerably. Many designs became simply unreadable, especially as small-screen and mobile devices became popular.

Implementing a design with spacer GIFs could be extremely tedious - particularly when making small changes to an existing design.

Obsolescence

The technique was obsolete for designing web pages by around 1998. Implementation of CSS allowed sizes of HTML objects to be set directly. Although CSS' adoption was slow, owing to poor browser implementations and developer inertia, the basic ability to control element placement as enabled by the use of spacer GIFs was usable by about 1997.

In addition, table- and grid-based layouts were replaced[citation needed] by fluid layouts in an attempt to respond to the growing use of mobile devices to access web content. These design methodologies abandoned the attempt to control two-dimensional layout between elements.[citation needed] Instead the elements would be offered to the reader's browser and the browser would place them as best it could, according to the size of the reader's browsing window. Fluid design layouts made the setting of page element sizes on the user's browser less important.[citation needed] This was particularly evident where it removed the need to set sizes in absolute units such as pixels. As the web designer had never been able to control the size of the reader's screen window, the attempt to set sizes rigidly had always been a mistake.

References

This article uses material from the Wikipedia English article Spacer GIF, which is released under the Creative Commons Attribution-ShareAlike 3.0 license ("CC BY-SA 3.0"); additional terms may apply (view authors). Content is available under CC BY-SA 4.0 unless otherwise noted. Images, videos and audio are available under their respective licenses.
®Wikipedia is a registered trademark of the Wiki Foundation, Inc. Wiki English (DUHOCTRUNGQUOC.VN) is an independent company and has no affiliation with Wiki Foundation.

Tags:

Spacer Gif HistorySpacer Gif UsageSpacer Gif DrawbacksSpacer Gif ObsolescenceSpacer GifBrowser warsCascading Style SheetsGIFHTMLWeb design

🔥 Trending searches on Wiki English:

Joseph BankmanForge (character)TwitterMckenna GraceARosanne CashJulius CaesarJenna OrtegaRastafariIsraelJake PaulZoe SaldañaGhostbustersKendrick Lamar2 Girls 1 CupMalaysia Airlines Flight 370Manchester United F.C.Kurt RussellList of solar eclipses visible from the United StatesHoly WeekFranklin D. RooseveltGodzilla (2014 film)Kinds of KindnessJake GyllenhaalVinayak Damodar SavarkarGeneral Dynamics F-16 Fighting FalconMax VerstappenTelegram (software)Suge KnightChang and Eng BunkerSergey BrinOpinion polling for the next United Kingdom general electionLiverpool F.C.Joe LiebermanKen MilesElizabeth TaylorDavid BeckhamShaitaan (2024 film)NapoleonMichael JordanPrincess Margaret, Countess of SnowdonJess HongRyan ReynoldsPatrick SwayzeAbraham OzlerPalm RoyaleTheo JamesDrake BellBrittany SnowSexI, Robot (film)Arnold SchwarzeneggerKalanithi MaranList of country calling codesAustraliaOlivia Rodrigo2024 Indian Premier LeagueFrankie MunizAlia BhattMary & GeorgeAbigail (2024 film)The Bear (TV series)Sama-BajauEuphoria (American TV series)R. KellyHoly WednesdayPoor Things (film)ChatGPTTraumatic inseminationBeetlejuice BeetlejuiceDavid CameronVietnamIsrael–Hamas warBill GatesHazbin Hotel🡆 More