Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pixel.gif, why do people use it?

Tags:

html

pixel

Just a simple question, why is pixel.gif usefull? And why should you use it or why not?

like image 807
Thew Avatar asked Apr 08 '11 10:04

Thew


2 Answers

Shim .gif's are transparent images typically 1x1 pixel in size. As noted above, these images should not be used for spacing in modern web browsers (2013) as CSS does a superior job of layout.

However, email marketing campaigns continue to leverage them for a couple of reasons:

  1. As an asset that can be used for marketing analytics (i.e. email opened?)
  2. For spacing issues arising from using tables for layout in email.

Email clients do not universally support CSS so it is best practices to code your newsletters and application alerts as if it were 1996.

like image 22
Tom Gerencser Avatar answered Sep 29 '22 11:09

Tom Gerencser


Pixel gifs (often called shim.gif) were used in older web designs (i.e. older than, say, 5 years ago) to provide a space in page or table layouts where a better understanding of robust CSS was lacking or if browser differences (typically between IE and Netscape) made life too complicated.

They should be considered a relic of the past and would not be seen in a professional CSS layout in today's web design. However it is still possible that older pages that haven't been maintained over the years will still have table-based page layouts with pixel shim images to provide some artificial spacing for columns.

In short, you should not use them unless an image is required for non-javascript statistics gathering for your site.

like image 99
Phil.Wheeler Avatar answered Sep 29 '22 11:09

Phil.Wheeler