Centering an image in the middle of a paragraph

Giganews Newsgroups
Subject: Centering an image in the middle of a paragraph
Posted by:  Jason Quinn (jason_qui…@yahoo.com)
Date: 23 Sep 2003

This is an absurdly simple question. Suppose I have a paragraph which
contains an image (of an equation) and I'd like the image to be
centered in the middle of the paragraph with space above and below.
How do I do this within XHTML and/or stylesheets? I've search for the
answer but I get deluged with the same question in different contexts.
Plus the responses have been so different that I don't know which are
hack answers versus the "best" answer. Here's a sample piece of HTML
talking (about spacetime) showing what I've been trying:

---------------------------
<p> Spacetime, the set of all events, has a shape just like the points
on the surface of the earth have a shape. The shape of spacetime in GR
is determined by Einstien's field equation:
<br clear="all" />
<span style="text-align:center;"><img src="equation.gif" alt="field
equation" title="field equation" /></span>
<br clear="all" />
You are not expected to know what this equation means. Just know that
the "T" in this equation represents a matter and energy distribution,
the big
"G" and little "g" are related to the shape of spacetime, and the
lambda is a
number which used to be thought to be equal to zero but newer
measurements
suggest that it may be nonzero.</p>
-----------------------------

This doesn't seem to work under Netscape 7 for Solaris. I don't want
to treat the text above and below the image as two different
paragraphs because they aren't. They are logically connected.

Jason

Replies