473,545 Members | 1,779 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 5226
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.malachiar ts.org%2F~smile y%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********@snea kemail.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.c om)
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*********@si hope.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
3483
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
5036
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 a table) and a main <div> underneath that. The main <div> is set to have a top margin of 3%, which works fine, except in NN4. There, it looks like...
3
14398
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
7564
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%" cellspacing="1">
9
3129
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
1414
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
14134
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 able to get the response in the <div> tag in mozilla (im takingthe HTML response), <script> function confirm() { xmlHttp=GetXmlHttpObject();...
11
3567
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 <divnargin How can I make the CSS please? Regards
2
9440
by: bgold12 | last post by:
Are there any non-semantic (i.e. actual) differences between the <p> tag and the <divtag?
0
7459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7653
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7803
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7411
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7749
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5965
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5322
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
695
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.