You are here: Re: Question: Aligning an image + text « HTML « IT news, forums, messages
Re: Question: Aligning an image + text

Posted by Jonathan N. Little on 01/25/06 23:29

Ridefort wrote:

> Good evening;
>
> I need to align an image with some text underneath it, i have made
> something like this:
>
> <p><img align=right vspace="3" hspace="5" src="image.jpg" alt=""><br>
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
>
> Unfortunatly it doesnt do the trick.
>
> Can someone explain to me how i can align an image to the left/right
> and have some text beneath that is equally aligned as the image?!
> No need to bother with browsertypes or whatever, its just for
> personnal use.
>
> TIA
> Andre Linoge

CSS:
..pixboxleft {
float: left; margin: 0 .5em .5em 0; border: 1px solid black;
}
..pixboxleft IMG {
display: block;
}
..pixboxright {
float: right; margin: 0 0 .5em .5em; border: 1px solid black;
}
..pixboxright IMG {
display: block;
}



HTML:
<div class="pixboxleft">
<img src="SomeImage.jpg" alt="some image">
Just some text about the image
</div>

<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...


I use a border to show you what it was doing, if your want to constrain
the image text to the width of the image, i.e., make it wrap rather than
expand the DIV, then you need to explicitly set a width to the DIV
accordingly

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация