RE: [PHP] Annoying display problem
| From: | David Freeman | Date: | Thu, 23 May 2002 23:43:50 +0000 |
| Subject: | RE: [PHP] Annoying display problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99014@lists.php.net to get a copy of this message | ||
> I want an image (aligned on the left side) with text beside
> it (aligned in the center). That sounds simple enough. But try as I
may, I
> can't get it to work.
> *************************************************************
> print "<br><div align='left'><img src='709-2585.jpg'
> width='120'
> height='120' alt=' '/></a></div><div
> align='center'>{$_SESSION['desc']}</div><br>";
> *************************************************************
> The pix is on the left where it should be, but the text
> isn't centered, but hangs either just underneath the pix. I've seen
many sites
> with this layout. Perhaps they've separated the image/text. But I
can't figure
> out how they did it.
Wrapping something in a <div> will often get you an implied <br>
depending on the circumstances. If you want text centred beside an
image that's not the most obvious solution is probably a table.
However, you might also try this (which is completely untested but may
do what you want...)
<div align="center">
<img src="image.jpg" width=120 height=120 alt="" align="left">
some text here, whatever...
</div>
I tend to think that centering is over-used in many web pages so I don't
often mix things like this but it may well produce the behaviour you're
looking for.
CYA, Dave