Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Web
Expertise: Beginner
Sep 4, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Getting Spaced Out

HTML's page layout features are limited for older browsers--tables provide one of the few ways you can force text or graphics to appear in particular positions. Another addition to your armory of layout tools is judicious use of spacer graphics.

A spacer graphic is a one pixel by one pixel transparent GIF (easily created in almost any bitmap graphics application). You can resize this spacer graphic using the HEIGHT and WIDTH properties of the <IMG> tag to force other page elements adjacent to it to appear in the position you want. What's more, it hardly adds any overhead to download times.

For example, this code forces the text to start 50 pixels from the left margin of the page:

<TITLE>Spacer GIF Example</TITLE>
<IMG SRC="spacer.gif" HEIGHT=1 WIDTH=50 BORDER=0>This text starts 50 pixels from the 
left margin.
Martin Kelly
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date