Home | All Questions | alt.html FAQ > CSS Presentation

How do I have an hspace on one side of an image only?

Use CSS. Supposing you want more space on the left than the right:

<img src="example.gif" width="50" height="50" alt="example"
style="margin-left: 20px;">

Unfortunately Netscape 4 gets wild if you do that: the picture covers part of the text. What you suggest is the correct approach, in principle, but due to serious bugs in Netscape's CSS support, I'd suggest at least using a "Netscape avoidance" trick then.

As a workaround, how about using an image processing program to add a suitable margin (of the background colour of the page) into the image itself? It wastes bandwidth but perhaps not too much.

Recommended Resources


Related Questions