HighDots Forums  

I'm using SSI inside a <div> can I prevent overlapping text?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss I'm using SSI inside a <div> can I prevent overlapping text? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default I'm using SSI inside a <div> can I prevent overlapping text? - 09-22-2003 , 01:36 PM






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

Reply With Quote
  #2  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: I'm using SSI inside a <div> can I prevent overlapping text? - 09-22-2003 , 02:17 PM






smiley pounced upon this pigeonhole and pronounced:
Quote:
I hope this is the right forum for this question; i know it crosses
over a few topics but here goes.
I'll snip the rest for now. Please fix your CSS first. This may help.

<http://jigsaw.w3.org/css-validator/v...ri=http%3A%2F%
2Fwww.malachiarts.org%2F~smiley%2Flunch.html>

If you would like to copy a working 2-col layout that I cobbed up for a
friend, feel free to use this one.

http://home.rochester.rr.com/bshagnasty/twocolumn.html

--
-bts
-This space intentionally left blank.


Reply With Quote
  #3  
Old   
Greg Schmidt
 
Posts: n/a

Default Re: I'm using SSI inside a <div> can I prevent overlapping text? - 09-22-2003 , 08:07 PM



On 22 Sep 2003 11:36:01 -0700, jlfu9bzk02 (AT) sneakemail (DOT) com (smiley) wrote:

Quote:
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.
I haven't looked at your page, but I can promise you that your browser
never sees the <!--exec ...> line, the server replaces it with the
output of the script before it sends it. In other words, your browser
only ever gets one version of the page, which is what you will see if
you do a "view source".

As Beauregard said, it is almost certainly a problem in your CSS.

--
Greg Schmidt (gregs (AT) trawna (DOT) com)
Trawna Publications (http://www.trawna.com/)


Reply With Quote
  #4  
Old   
kchayka
 
Posts: n/a

Default Re: I'm using SSI inside a <div> can I prevent overlapping text? - 09-22-2003 , 08:50 PM



smiley wrote:
Quote:
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.

http://www.malachiarts.org/~smiley/lunch.html
..values {position: absolute;...}

Absolutely positioned elements are removed from normal flow, so the
height of these text elements is not included in the total height of the
SSI-supplied content. Don't absolutely position them and the problem
may go away.

--
To email a reply, remove (dash)ns(dash). Mail sent to the ns
address is automatically deleted and will not be read.



Reply With Quote
  #5  
Old   
AT
 
Posts: n/a

Default overlapping text? - 09-23-2003 , 01:50 PM



kchayka <kcha-ns-yka (AT) sihope (DOT) com> helpfully noted:

Quote:
.values {position: absolute;...}

Absolutely positioned elements are removed from normal flow, so the
height of these text elements is not included in the total height of the
SSI-supplied content. Don't absolutely position them and the problem
may go away.
Thanks kchayka for taking the time to look at my css before suggesting
a fix. And of course both of you who noted that the SSI stuff is done
BEFORE the server pushes any HTML to the browser are correct (duh...
what was I thinking??)

OK, right. If i make the .values {position: relative; ...} it fixes
the overlap between the text returned from the SSI and the footer.
However, if that's the only change I make, then the values returned by
the SSI don't obey the margins set by <div> one, so they overlap the
border. And they don't line up nice on the left side anymore :-(

*sigh* guess I have some more css learning to do. thanks again
kchayka for your pointer.

cheers,

smiley


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.