Even though the height is dynamic, you should be able to place the
image relative to the bottom by using the bottom css/style property.
The CSS bottom property is made for this, and that's how Jeffrey's
example works.  I wouldn't call it a float, however -- you can't stack
multiple objects with 'bottom' like floats,  and content flow works a
little differently.

The explanation at Mozilla docs is verbose, but complete:

http://developer.mozilla.org/en/docs/CSS:bottom

Charles

On Oct 22, 12:33 pm, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> Would you be able to use a purely CSS solution, rather than a javascript
> one?
>
> Something like:
>
> http://www.scorpiontechnology.com/cobalt/floatbottom.htm
>
> Simulates a float:bottom type of style.
>
> JK
>
> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Chris J. Lee
> Sent: Monday, October 22, 2007 10:18 AM
> To: jQuery (English)
> Subject: [jQuery] Align to bottom (Div)
>
> Trying to figure out a solid efficient algorithm for aligning objects
> to the bottom. The div is a column and the height is dynamic because
> the contents of the right column changes. (see below)
>
> so say the markup for the image is this:
> <div id="container">
>
> <div id="col-left" class="alignstupidbottom">
>    <img  src="blahblah.gif" />
> </div>
>
> <div id="col-right">
>   <p>contents</p>
> </div>
>
> </div>
>
> so in order to align say an image to the bottom you have to do this:
>
> 1. find the height of the container
> 2. find the height of the image
> 3. subtract height of container - height of image
> 4. set the position of the image with margin top.
>
> correct? Is there a more efficient way?

Reply via email to