Tips
All Tips ]

Position an image to the nearest pixel

With stylesheets, you can precisely position an image in your page, regardless of the window size or browser used. Here's how you use this tip:

<IMG STYLE="position:absolute; TOP:45px; LEFT:180px; WIDTH:100px; HEIGHT:100px" SRC="image.gif">

TOP corresponds to the space in relation to the upper edge of the page, LEFT in relation to the left edge. WIDTH and HEIGHT define the size of your image. All are expressed in pixels.

An image positioned to the nearest pixel:







Compatibility. This tip will not work with Netscape.

Discover all Webmaster tips.