473,508 Members | 3,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keeping text in its container

I am trying to understand the deeper meanings of containers. One would say:
everything inside the container div will stay inside, but apparently that's
not true.

My test code is below. When I run this in IE everything seems fine, when I
run it in Firefox the text runs out of the right box and the right box runs
out of the overall container. I don't understand the reason for this??? I
would like to make both columns the same height while text in either columns
is longest.

I am not looking for code that I can simply cut-and-paste, I want to
understand what's happening !!!

<html>
<head>
<title>Alignment test</title>
<style>
body
{
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#container
{
background-color:pink;
border:1px solid red;
width:100%;
height:100%;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
top:0px;
left:0px;

}

#left
{
position:absolute;
top:0px;
left:0px;
margin:0;
padding:0;
border: 1px solid black;
text-align:left;
width:20%;
}

#right
{
position:relative;
left:20%;
margin:0;
padding:5px 5px 5px 5px;
border: 1px solid yellow;
width: 40%;
text-align:right;
height:100%;
}


</style>
</head>
<body>
<div id="container">
<div id="left">

text left side
</div>
<div id="right">
[1] Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque
doctrina
philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus,
fore
ut hic noster labor in varias reprehensiones incurreret. nam quibusdam, et
iis quidem non admodum indoctis, totum hoc displicet philosophari.
quidam autem non tam id reprehendunt, si remissius agatur, sed tantum
studium tamque multam operam ponendam in eo non arbitrantur. erunt etiam,
et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se
dicant in Graecis legendis operam malle consumere. postremo aliquos
futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi,
etsi sit elegans, personae tamen et dignitatis esse negent.
[2] Contra quos omnis dicendum breviter existimo. Quamquam philosophiae
quidem vituperatoribus satis responsum est eo libro, quo a nobis
philosophia
defensa et collaudata est, cum esset accusata et vituperata ab Hortensio.
qui liber cum et tibi probatus videretur et iis, quos ego posse iudicare
arbitrarer, plura suscepi veritus ne movere hominum studia viderer,
retinere
non posse. Qui autem, si maxime hoc placeat, moderatius tamen id volunt
fieri,
difficilem quandam temperantiam postulant in eo, quod semel admissum
coerceri
reprimique non potest, ut propemodum iustioribus utamur illis, qui omnino
avocent a philosophia, quam his, qui rebus infinitis modum constituant in
reque eo meliore, quo maior sit, mediocritatem desiderent. [3] Sive enim
ad sapientiam perveniri potest, non paranda nobis solum ea, sed fruenda
etiam [sapientia] est; sive hoc difficile est, tamen nec modus est ullus
investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est,
cum id, quod quaeritur, sit pulcherrimum. etenim si delectamur, cum
scribimus, quis est tam invidus, qui ab eo nos abducat? sin laboramus,
quis est, qui alienae modum statuat industriae? nam ut Terentianus
Chremes non inhumanus, qui novum vicinum non vult 'fodere aut arare
aut aliquid ferre denique' -- non enim illum ab industria, sed ab
inliberali labore deterret --, sic isti curiosi, quos offendit noster
minime nobis iniucundus labor.
[1] Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque
doctrina
philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus,
fore
ut hic noster labor in varias reprehensiones incurreret. nam quibusdam, et
iis quidem non admodum indoctis, totum hoc displicet philosophari.
quidam autem non tam id reprehendunt, si remissius agatur, sed tantum
studium tamque multam operam ponendam in eo non arbitrantur. erunt etiam,
et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se
dicant in Graecis legendis operam malle consumere. postremo aliquos
futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi,
etsi sit elegans, personae tamen et dignitatis esse negent.
[2] Contra quos omnis dicendum breviter existimo. Quamquam philosophiae
quidem vituperatoribus satis responsum est eo libro, quo a nobis
philosophia
defensa et collaudata est, cum esset accusata et vituperata ab Hortensio.
qui liber cum et tibi probatus videretur et iis, quos ego posse iudicare
arbitrarer, plura suscepi veritus ne movere hominum studia viderer,
retinere
non posse. Qui autem, si maxime hoc placeat, moderatius tamen id volunt
fieri,
difficilem quandam temperantiam postulant in eo, quod semel admissum
coerceri
reprimique non potest, ut propemodum iustioribus utamur illis, qui omnino
avocent a philosophia, quam his, qui rebus infinitis modum constituant in
reque eo meliore, quo maior sit, mediocritatem desiderent. [3] Sive enim
ad sapientiam perveniri potest, non paranda nobis solum ea, sed fruenda
etiam [sapientia] est; sive hoc difficile est, tamen nec modus est ullus
investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est,
cum id, quod quaeritur, sit pulcherrimum. etenim si delectamur, cum
scribimus, quis est tam invidus, qui ab eo nos abducat? sin laboramus,
quis est, qui alienae modum statuat industriae? nam ut Terentianus
Chremes non inhumanus, qui novum vicinum non vult 'fodere aut arare
aut aliquid ferre denique' -- non enim illum ab industria, sed ab
inliberali labore deterret --, sic isti curiosi, quos offendit noster
minime nobis iniucundus labor.

</div>
</div>
</body>
</html>
Sep 22 '06 #1
1 1660
Sjef wrote:
>
everything inside the container div will stay inside, but apparently that's
not true.
You are right, it is not always true, however, in this instance it is
because Fx follows Quirky behavior without a Doctype.
Apply a Strict Doctype and it will behave as you expected in both IE and Fx.

--
Gus
Sep 22 '06 #2

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

Similar topics

3
8606
by: Bill M. | last post by:
Hello, What's up with this? I've got a <td id="container"> and want to set the text in this cell like .... var container = document.getElementById('container'); container.data = "Data in...
3
7344
by: Jonah Bishop | last post by:
I have a puzzling problem with centering text, and I'm hoping that someone here can help me out. First of all, let me state that I am using XHTML 1.0 Strict and CSS for all layout purposes (no...
4
2300
by: jake | last post by:
Maybe some kind person can help with a suggestion or two ;-) I want to construct a banner on a number of pages in the format: LHS: Text (variable content) RHS. Logo ..... each with a...
1
1136
by: tshad | last post by:
I have a DataList where I am trying to set the background color to particular DataListItems: Dim oDLI as DataListItem = s.parent.parent oDLI.BackColor = System.Drawing.Color.Green This works...
1
2286
by: Alan Silver | last post by:
Hello, I have a page in which I'm trying to give the user the chance to manipulate a list of items. These are the price variations for a product, so each item consists of a name (eg, small,...
19
2339
by: pinkfloydhomer | last post by:
Please read the example below. I'm sorry I couldn't make it smaller, but it is pretty simple. When client code is calling newThingy(), it is similar to malloc: the client gets a pointer to a...
2
9687
by: Bazza Formez | last post by:
I have a bound field in a DetailsView control that displays free form description type data from my SQL database table (typical data is a couple of paragraphs of written product description being...
1
2581
by: dhaneshrs | last post by:
I have a small code that shows inactive and active users from the ms access DB. <%@ Page Language="VB" MasterPageFile="~/MasterPageAdmin.master" Title="Welcome" %> <%@ Import...
1
4183
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
7228
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
7128
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...
0
7332
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,...
1
7058
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...
0
5635
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,...
1
5057
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
4715
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
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.