How can I get rid of the small gap between a left-aligned image and the edge of the browser window?
As you’ve discovered by now, most browsers will automatically offset the contents of a Web page by several pixels along the window’s top and left margins. This can result in a lot of headaches for a designer who tries to position a GIF precisely within the browser window or a background image. Interestingly, the number of pixels your image is offset when viewed by your readers will differ, depending on which browser is used; this can even vary among several versions the same browser. Designer David Siegel offers real-world examples of how these variations in browser versions affect your page’s display at Browser Offsets: The Good, The Bad, and the Ugly. Microsoft’s Internet Explorer has two proprietary tags, LEFTMARGIN and TOPMARGIN, that give you control over these margin settings. You can change the default settings to any desired value, or eliminate the margin altogether by setting LEFTMARGIN and TOPMARGIN both to 0.
As you’ve discovered by now, most browsers will automatically offset the contents of a Web page by several pixels along the window’s top and left margins. This can result in a lot of headaches for a designer who tries to position a GIF precisely within the browser window or a background image. Interestingly, the number of pixels your image is offset when viewed by your readers will differ, depending on which browser is used; this can even vary among several versions the same browser. Designer David Siegel offers real-world examples of how these variations in browser versions affect your page’s display at Browser Offsets: The Good, The Bad, and the Ugly. Microsoft’s Internet Explorer has two proprietary tags, LEFTMARGIN and TOPMARGIN, that give you control over these margin settings. You can change the default settings to any desired value, or eliminate the margin altogether by setting LEFTMARGIN and TOPMARGIN both to 0. Netscape’s Navigator currently has no comparable proprietary tags,