JWS said:
I did that, and I am now experimenting with it. Many thanks. I
found the thread about this also (
http://tinyurl.com/3chdvh).
About "short" vs. "long" captions: the problem is not so much the
length of the captions themselves, but the fact that they may be
of *different* length. For instance, try to make a few captions in
your example page "long". A picture may be "stuck" (refuse to
float to the left) if the picture above and to the left has a
longer caption than the picture directly above. To cure this, it
seems necessary to give all captions the same, sufficient, height,
as per Yucca's recommendation. But this risks wasting screen
space, and the height (even when given in ems) may not be
sufficient after all if the font size is increased.
Maybe javascript can be used to make this "dynamic" also. I'll
start studying javascript anyway, because I would like to
understand bootnic's script (in particular I do not understand the
"!!" operator in the fifth line..).
Yes, I see your concern. When I said about short captions, it was
quite deliberate. If you are going to have some long captions
then this changes how you must tackle the issue. In the template
series I offered before, you will have noticed the management of
the pages into landscapes, portraits and very wide strips (the
latter suitable for 'film strip thumbnails' for movies). And that
the divs that housed the thumbs in each category were the same
width. The height comes naturally from the pic/caption pairs.
This gets the neatest look as long as the pics are the same
height and the captions very similar in length.
But things are rather different if you want long captions thrown
in here and there. I am not sure I would have offered the
template had you not said short caption in your original post <g>
If you want to accommodate long captioned pics, then there are
'management' ways. If there are just very few of these long ones,
do not let them loose among the tidy ones!
Group all the long captioned pics together and don't have any
captions that are too way out of kilter in size with the other
long captions or the problem you notice (of floats catching) will
reappear. The other thing you can do, it has its downsides, is to
give a generous enough explicit height to the float boxes, enough
to accommodate the tallest pic/caption pairs. You can do this in
ems. It is easy to decide on a 'good enough' em dimension once
you know the length of the longest caption in any group.
O, and btw, if you have long captions, text-align: center looks
awful, make it left for these.