473,513 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
Jul 20 '05 #1
4 5223
smiley pounced upon this pigeonhole and pronounced:
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.
Jul 20 '05 #2
On 22 Sep 2003 11:36:01 -0700, jl********@sneakemail.com (smiley) wrote:
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 (gr***@trawna.com)
Trawna Publications (http://www.trawna.com/)
Jul 20 '05 #3
smiley wrote:

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.

Jul 20 '05 #4
kchayka <kc*********@sihope.com> helpfully noted:
.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
Jul 20 '05 #5

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

Similar topics

1
3472
by: Xah Lee | last post by:
with strict HTML spec, can one have <p> tags inside table's <td> tag? also, in strict XHTML, can one have <p> tages inside <div>? Thanks. Xah xah@xahlee.org ∑ http://xahlee.org/
4
5033
by: Ian Rastall | last post by:
This really is a JavaScript question. I have a site that looks fine in everything but NN4. I'm afraid I don't have a URL, because the site is very much unfinished. The site is a header (which is...
3
14397
by: Joseph Haig | last post by:
I have a style sheet containing the following definitions: #leftcontent { position: absolute; left:20px; top:60px; width:180px; border:1px solid #000; padding-top: 15px; }
2
7563
by: listaction | last post by:
Hi Folks, can you help me by explaining how the code below can be translated using <div> and achieve the same effect? Thanks, LA <html> <body> <table bgcolor="#000000" width="100%"...
9
3122
by: Julia Briggs | last post by:
How do I construct a <iframe> or equivalent for FireFox/NS browsers, inside a screen centered <div> tag? Can it be done?
1
1411
by: menmysql | last post by:
hi to all i want to place a division(using <div> tag) at a perticular location(x,y). is it possible. if possible please tell me how to do it. regards
10
14130
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam...
11
3564
by: Bob | last post by:
He at all I have a <DIVwith a long text and a <buttonat the very bottom I want to center the button and to justify the text and I want the text-margin-left and right of 2em relative to the...
2
9437
by: bgold12 | last post by:
Are there any non-semantic (i.e. actual) differences between the <p> tag and the <divtag?
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.