I hope this is the right forum for this question; i know it crosses
over a few topics but here goes. I have a page that uses a
server-side include perl script to return a list of name/value pairs
from a text file. The last value is variable length- the shortest
return is about 300 characters, and the longest is about 6000 or so.
This SSI lives inside a <div> on a page with a few other text <div>s;
a simplified example of the layout is:
<div id="one"> some text here, and a border around the next two divs
<div id="two"><!--#exec perl.cgi script here--></div>
<div id="three"> more text here, below the script output</div>
</div> <!-- end of div one, so that the border wraps everything -->
Unfortunately what happens is that when the page renders, the text
that comes back from the SSI in <div> two tends to overlap (or fall
underneath) the static text in <div> three, especially for the longer
reviews or when the page is narrow. It's almost like the browser
renders the divs and calculates the length of <div> two based on the
<!--#exec etc ---> line, and then when the script returns something
longer the browser mooshes it all into a <div> that is only large
enough to hold one line. I've tried position: relative; and absolute;
for both <div>s two and three, and it doesn't seem to make a
difference either way.
So for now my workaround is to put a bunch of <br> tags in the space
between <div> one and <div> two- but this is a hack at best, leaves a
bunch of uncontrollable whitespace on the page for short reveiws, and
fails miserably when the browser window is narrower than about 900
pixels (like on an 800x600 laptop screen).
The page itself is at
http://www.malachiarts.org/~smiley/lunch.html
and you can see the overlap effect for yourself if you resize the
browser window to make it narrower.
What i'd like to know is if there is some way to force the browser to
caluclate the length of a <div> AFTER the ssi has executed, or
alternately, if there is a way to force <div> 3 to always fall below
the last text character in <div> two? I'd appreciate any suggestions
or references to any pages that have solved a similar problem.
Cheers,
smiley