473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Align <div>'s at the bottom?

I have a few thumbnail images each surrounded by a few links. So I put
the thumbnail and the links in a div tag and set the div's to
float:left. So my intent is to have the thumbnails wrap at the edge of
the browser. Problem is the images are not all the same size and when
an image wraps, it stops next to the first image that is taller. Here
is some code:

<div style="float:left">
<a href="#">link 1</a>
<a href="#">link 2</a><br />
<img src="thumb1.jpg">
</div>

<div style="float:left">
<a href="#">link 1</a>
<a href="#">link 2</a><br />
<img src="thumb2.jpg">
</div>

<div style="float:left">
<a href="#">link 1</a>
<a href="#">link 2</a><br />
<img src="thumb3.jpg">
</div>

As mentioned, if thumb1 is taller than thumb2, when thumb3 wraps to the
next line, it buts up against (to the right of) thumb1 instead of to
the left side of the page. How do I overcome this? I thought maybe if
I can get the images align at the bottom, I would be fine but I can't
seem to be able to do that either. This doesn't seem to work with IE6:

<div style="vertical-align: bottom">
<div style="float:left">
<a href="#">link 1</a>
<a href="#">link 2</a><br />
<img src="thumb1.jpg">
</div>

<!-- etc ..... -->

</div>

Any ideas?

Jul 10 '06 #1
2 4880
Els
ge***********@gmail.com wrote:
So my intent is to have the thumbnails wrap at the edge of
the browser. Problem is the images are not all the same size and when
an image wraps, it stops next to the first image that is taller.
<div style="float:left">
<a href="#">link 1</a>
<a href="#">link 2</a><br />
<img src="thumb1.jpg">
</div>
[snip]
As mentioned, if thumb1 is taller than thumb2, when thumb3 wraps to the
next line, it buts up against (to the right of) thumb1 instead of to
the left side of the page. How do I overcome this?
By setting the height of the floated divs - make them all equal
height. Do this in ems to accommodate for font resizing, since you
have text in the divs.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: Daniela Mercury - O Canto Da Cidade
Jul 10 '06 #2
That's my current solution now. I was hoping for something a bit more
elegant as my images are uploaded via a webform and they could have
various sizes.
Els wrote:
ge***********@gmail.com wrote:
So my intent is to have the thumbnails wrap at the edge of
the browser. Problem is the images are not all the same size and when
an image wraps, it stops next to the first image that is taller.
<div style="float:left">
<a href="#">link 1</a>
<a href="#">link 2</a><br />
<img src="thumb1.jpg">
</div>

[snip]
As mentioned, if thumb1 is taller than thumb2, when thumb3 wraps to the
next line, it buts up against (to the right of) thumb1 instead of to
the left side of the page. How do I overcome this?

By setting the height of the floated divs - make them all equal
height. Do this in ems to accommodate for font resizing, since you
have text in the divs.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: Daniela Mercury - O Canto Da Cidade
Jul 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Terry | last post by:
hi guys, could anyone help me with this? I tried to put a <div> in a <td>, and a <table> in that <div>. It looks fine, but my div can't fit in my <td>, there's always a space between the bottom of...
8
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a...
8
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is...
14
by: Simon Wigzell | last post by:
I want to display HTML text inside a div and have the page open scrolled to the bottom. (My div has overflow:auto so that it appears with scroll bars) I have found this that works on a textarea:...
2
by: billflu | last post by:
I have a two column table. That looks like this. ____________________ | | | |-----| | | | | | | | | | | |____...
8
by: tomasio | last post by:
Dear NG-Readers, I forgot to post the URL to the html-file and the linked CSS. Here they are: html: http://tomasio.at/temp/Unterseite_Templ2.html CSS: http://tomasio.at/temp/stylesheet.css...
2
by: Nikolai Onken | last post by:
Hey, I am trying to learn the exact behavior of CSS and was just placing a couple of <div>'s after each other. Each of the <divhas a <pwithin and some text within the <p> Now when I add a...
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.