Click here to get back home

Forcing adjacent elements to have the same height

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Forcing adjacent elements to have the same height Rennie deGraaf 05-17-2005
Posted by Rennie deGraaf on May 17, 2005, 11:28 pm
Please log in for more thread options


Is it possible to force adjacent block elements to have the same height,
without specifying that height?

In this page (http://pages.cpsc.ucalgary.ca/~degraaf/test/index3.html),
I have a bunch of (red-bordered) DIVs containing an image thumbnail and
a caption. These DIVs are floated to the left, and I used JavaScript to
center them (since there is no float: center and most browsers don't
support display: inline-block). I know the dimensions of the
thumbnails, so I can code the width into the stylesheet, but the
captions are script-generated, so I don't know the height of the
caption. Since I don't know the width of the browser window, I don't
know how many DIVs will fit on a row. I do, however, want all DIVs on
the same row to have the same height, which must be at least great
enough to enclose the longest caption in that row. It will be
sufficient if all of the image DIVs on the same page have the same height.

What I'm really trying to accomplish is to force these DIVs into rows
from the left edge to the right edge, with no gaps. If there's some
other way to accomplish this, please let me know.

Now, I known that I can do this with JavaScript or a table layout. Is
it possible with only CSS?

Thanks,
Rennie

Similar ThreadsPosted
forcing two hr on the same line January 5, 2007, 10:22 am
Small Screen Rendering : Forcing It March 10, 2007, 10:20 pm
forcing ie to save the contents of the html instead of displaying it September 9, 2005, 5:47 pm
Forcing retrieval of a fresh copy of a file with a link May 30, 2008, 8:47 am
Make textboxs height = the height of the cell it's in minus (n)px August 6, 2004, 6:37 am
Adjust height base on the the height of the browser window. October 20, 2006, 4:23 pm
CSS for All Elements (Bullets February 22, 2005, 12:17 pm
CSS gap between inline elements February 7, 2008, 3:03 am
Form and nested elements November 10, 2004, 11:57 am
Visibility of form elements December 3, 2004, 8:01 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap