473,793 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making the container grow

Here's the code:

<html>
<head>
<title>CSS Test</title>
<style>
div.container {
border-width:1px;
border-color:#000;
border-style:solid;
}

div.box {
border-width:1px;
border-color:#F00;
border-style:solid;
width:200px;
height:200px;
float:left;
}
</style>
</head>
<body>
<div class="containe r">
<div class="box"></div>
Hello World
</div>
</body>
</html>

When viewing this using Mozilla 1.6 and Opera 7.51 (don't know about
other browsers, no chance to test on them), the box-div breaks out of
the container-div (which only surrounds "Hello World").
When I remove the float:left; it works again, but I really do need it in
my layout.

Is there a way to make the container automatically include the
float:left;-div?
Thanks for any hints,
Florian
Jul 20 '05 #1
6 7147
Els
Florian Brucker wrote:
Here's the code:

<html>
<head>
<title>CSS Test</title>
<style>
div.container {
border-width:1px;
border-color:#000;
border-style:solid;
}

div.box {
border-width:1px;
border-color:#F00;
border-style:solid;
width:200px;
height:200px;
float:left;
}
div.clearall{
clear:both;
}
</style>
</head>
<body>
<div class="containe r">
<div class="box"></div>
Hello World
<div class="clearall "></div>
</div>
</body>
</html>

When viewing this using Mozilla 1.6 and Opera 7.51 (don't
know about other browsers, no chance to test on them), the
box-div breaks out of the container-div (which only
surrounds "Hello World"). When I remove the float:left; it
works again, but I really do need it in my layout.

Is there a way to make the container automatically include
the float:left;-div?


See my additions above :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Bon Jovi - Lay Your Hands On Me
Jul 20 '05 #2
On Mon, 26 Jul 2004 23:39:00 +0200, Florian Brucker <to**@torfbold. com>
wrote:
Here's the code:
Why not a URL? Why make more work for me when you want my help?
When viewing this using Mozilla 1.6 and Opera 7.51 (don't know about
other browsers, no chance to test on them), the box-div breaks out of
the container-div (which only surrounds "Hello World").
When I remove the float:left; it works again, but I really do need it in
my layout.
You gave an explicit height to the float, but does the container have any
height? What is it's height? Answer: it's content. The float is out of the
flow, so it's height isn't factored in. The container div should be only
1em high (if the text does not wrap). And looky, it is. Your example is a
perfect expression of what float really does.
Is there a way to make the container automatically include the
float:left;-div?


Not really.

Adding enough content to the container after the float to make the div
tall enough is what's normally done. Or set a height on the container, but
there's problems in that too. Min-height would be perfect here except for
IE's asinine CSS compatability.
Jul 20 '05 #3
On Mon, 26 Jul 2004 17:55:07 -0400, Neal <ne*****@yahoo. com> wrote:
On Mon, 26 Jul 2004 23:39:00 +0200, Florian Brucker <to**@torfbold. com>
wrote:

Is there a way to make the container automatically include the
float:left;-div?


Not really.


Except for what Els said. :-\
Jul 20 '05 #4
Els
Neal wrote:
On Mon, 26 Jul 2004 17:55:07 -0400, Neal
<ne*****@yahoo. com> wrote:
On Mon, 26 Jul 2004 23:39:00 +0200, Florian Brucker
<to**@torfbold. com> wrote:

Is there a way to make the container automatically
include the float:left;-div?


Not really.


Except for what Els said. :-\


Time for coffee? ;-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Bon Jovi - Lay Your Hands On Me
Jul 20 '05 #5
On 26 Jul 2004 21:59:53 GMT, Els <el*********@ti scali.nl> wrote:
Neal wrote:
On Mon, 26 Jul 2004 17:55:07 -0400, Neal
<ne*****@yahoo. com> wrote:
On Mon, 26 Jul 2004 23:39:00 +0200, Florian Brucker
<to**@torfbold. com> wrote:

Is there a way to make the container automatically
include the float:left;-div?

Not really.


Except for what Els said. :-\


Time for coffee? ;-)


ALWAYS time for coffee! 8-D
Jul 20 '05 #6
Okay, thanks you both!

(And sorry for not putting it online but posting the code, will do
better next time.)

Florian
Jul 20 '05 #7

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

Similar topics

2
1668
by: pc | last post by:
Hi, Currently we are using a CDwordArray type array to store some DWORD data. This data is dynamic and we need to continuously grow the array size using SetAtGrow() . Due to performance reasons, we are planning to try out other possible choices (Cmap,Clist,STL.....). We want to use the Container that has the best performance in terms of insertion & random access. We would like to know the STL Container Class that would suit this scenario.
2
1450
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild, AppendChild, making width grow? Hi,
2
2144
by: Jayjay | last post by:
I'm trying to get a report that will have something like the below layout: Item # Item Description Quantity Unit $ Total $ ~~~~~~~~~~ The Item Description field is set to "can grow = Yes" so that if the description is long it will wrap to another line.
16
2077
by: Sensei | last post by:
Hi! I'm looking for something similar to the map container, but with a slight modification, a unique key, with multiple assignments to each one. I think some container in the STL has it, but I cannot see it. So I can assign to a key like a map: // pseudo c++ code container<int, int> m;
11
16300
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much appreciated. Thanks
7
4694
by: toton | last post by:
Hi, I have a STL vector of of characters and the character class has a Boost array of points. The things are vector<Characterchars; and class Character{ private: array<Point,Npoints; }; Now are the memory layout is contiguous? i.e all the character resides side by side just like array, and all Points side by side insede the
2
1692
by: andrew18 | last post by:
Hi All, Two questions: 1. Is it possible to make a floated div grow in width with its contents? I've been searching on the web for a way to make the width of a float grow with the width of its content, without success. There's loads of information about how to do this with heights, but I can't find anything that works for widths. Is it possible?
20
4652
by: Martin Jørgensen | last post by:
Hi, I'm reading a number of double values from a file. It's a 2D-array: 1 2 3 4 5 6 7 ------------- 1 3.2 2 0 2.1 3 9.3 4
5
2617
by: Olumide | last post by:
Hello - To begin with, I'm not the most experienced STL use out there but I'm slowly getting there. One bug(?) that's plagued me of recent is the way the OS (or is it STL?) appears to relocate a container in memory if for example the container needs to grow, with the result that any references (iterators included) to items in such a container cease to be valid and may return the address 0xCDCDCD or 0xDDDDDD in the windows environment (I...
0
9518
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7538
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
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 we have to send another system
3
2917
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.