473,796 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

float breaking out of box

I have a floated container that is breaking out of it's containing
block. I don't remember the tricks to fix that (sorry Dorayme).

Jeff
Sep 9 '08 #1
5 4130
Jeff wrote:
I have a floated container that is breaking out of it's containing
block. I don't remember the tricks to fix that (sorry Dorayme).

Floats don't contribute to the height of their containers, as they are
considered "out of the flow". Therefore, you need some way to give the
container some height.

Some things you can do about this include setting overflow:hidden ; (or
any value besides "visible") or position:absolu te; on the container.

--
John
The possessive pronoun, "its", has no apostrophe. Even on the Internet.
Sep 9 '08 #2
Jeff schrieb:
I have a floated container that is breaking out of it's containing
block. I don't remember the tricks to fix that (sorry Dorayme).
Here's what I use:

--- common.css ---
#container:afte r
{
clear: both;
display: block;
height: 0;
content: ".";
visibility: hidden;
}

--- ie.css ---
#container
{
zoom: 1;
height: 1px;
he\ight: auto;
}

--- page.html ---
<link rel="stylesheet " media="all" type="text/css" href="common.cs s">
<!--[if IE]><link rel="stylesheet " href="ie.css">< ![endif]-->

For standard compliant browsers supporting the content property, we
simply add an additional block at the end of #container and have it
clear the float.

IE does not support the content property, but has a proprietary internal
property called "layout". If this is set, a side effect will be that all
floated children will be enclosed by their #container. To set it (can't
be done directly), use either the proprietary zoom property or assign a
height. The above solution caters for IE5 and above.

Greetings,
Thomas

--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
Sep 9 '08 #3
In article <Qa************ *************** ***@earthlink.c om>,
Jeff <jeff@spam_me_n ot.comwrote:
I have a floated container that is breaking out of it's containing
block. I don't remember the tricks to fix that (sorry Dorayme).

Jeff
Well, Jeff, perhaps you lost the link to my

<http://netweaver.com.a u/floatHouse/>

In the face page, see sections 6, 7 and 8.

But, briefly (how I hate brevity):

Use overflow: hidden or overflow: auto on the parent container. But
safest probably is to stick in a non floated child with a style="clear:
both;" on it after the floats. That makes the parent sit up and listen
even for IE6. I say safest because I have seen occasional situations in
IE6 where the parent does not grow height naturally for its floated
children and it will not be forced to do so by overflow instructions. I
recall it was you who brought this to my attention once!

--
dorayme
Sep 10 '08 #4
dorayme wrote:

Hello Dorayme,
In article <Qa************ *************** ***@earthlink.c om>,
Jeff <jeff@spam_me_n ot.comwrote:
> I have a floated container that is breaking out of it's containing
block. I don't remember the tricks to fix that (sorry Dorayme).

Jeff

Well, Jeff, perhaps you lost the link to my

<http://netweaver.com.a u/floatHouse/>
Thanks, Lost in the clutter!
>
In the face page, see sections 6, 7 and 8.

But, briefly (how I hate brevity):

Use overflow: hidden or overflow: auto on the parent container.
That I had forgotten.
But
safest probably is to stick in a non floated child with a style="clear:
both;" on it after the floats. That makes the parent sit up and listen
even for IE6.
That I could not do. I had a bit of javascript that toggled the next
node on/off.

I say safest because I have seen occasional situations in
IE6 where the parent does not grow height naturally for its floated
children and it will not be forced to do so by overflow instructions. I
recall it was you who brought this to my attention once!
It was indeed!

I've been insanely busy, I still have something for you...

Thanks,
Jeff
>
Sep 10 '08 #5
Thomas Mlynarczyk wrote:
Jeff schrieb:
> I have a floated container that is breaking out of it's containing
block. I don't remember the tricks to fix that (sorry Dorayme).

Here's what I use:

--- common.css ---
#container:afte r
{
clear: both;
display: block;
height: 0;
content: ".";
visibility: hidden;
}

--- ie.css ---
#container
{
zoom: 1;
height: 1px;
he\ight: auto;
}
I find this absolutely fascinating. I had never used the after pseudo
element.
>
--- page.html ---
<link rel="stylesheet " media="all" type="text/css" href="common.cs s">
<!--[if IE]><link rel="stylesheet " href="ie.css">< ![endif]-->

For standard compliant browsers supporting the content property, we
simply add an additional block at the end of #container and have it
clear the float.

IE does not support the content property, but has a proprietary internal
property called "layout". If this is set, a side effect will be that all
floated children will be enclosed by their #container. To set it (can't
be done directly), use either the proprietary zoom property or assign a
height. The above solution caters for IE5 and above.
Thanks. I'm still soaking some of it up...

Jeff
>
Greetings,
Thomas
Sep 10 '08 #6

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

Similar topics

1
4077
by: maxim vexler | last post by:
in a book i am ready now : O'Reilly - Web Database Application with PHP and MySQL, 2nd ed. by David Lane, Hugh E. Williams on chapter 9 the author give an example for age validation : (simplified code, not a direct quote) $dob = mktime(0,0,0, 5, 3, 1983); if ((float)$dob > (float)strtotime("-18years")) {
0
1193
by: Nick Coghlan | last post by:
<Sorry for the disconnected reply -I've been having news server issues, and just switched to the mailing list instead> A quick check of the source code reveals that this behaviour is deliberate. There is apparently an issue with the corner case breaking badly (potentially raising an exception) on some platforms. So, Python plays it safe and converts the two boundary cases to Python longs instead of Python ints. See the code for the...
27
2111
by: Curtis Morrison | last post by:
Please help! I've been trying to figure this out for days now, with no luck. the following web page loads fine in MSIE, but NN 7 breaks it. I would really appreciate any suggestions that anyone might have. I tried setting the positioning to relative, as well as added broders, to the elements that break in NN7, with no luck. Here's the site: http://www.dataaxiom.com/Default.htm Also, I'm wondering if I'm even doing the CSS...
54
8380
by: Andy | last post by:
Hi, I don't know if this is the correct group to post this, but when I multiply a huge floating point value by a really small (non-zero) floating point value, I get 0 (zero) for the result. This creates a big hole in a 32-bit timer routine I wrote. Questions. 1. Why does this happen? 2. Is there C macros/functions I can call to tell me when two non-zero numbers are multiplied and the
53
8225
by: Zhiqiang Ye | last post by:
Hi, All I am reading FAQ of this group. I have a question about this: http://www.eskimo.com/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is all-bits-zero, and does not therefore guarantee useful null pointer values (see section 5 of this list) or floating-point zero values.
6
2916
by: Steve | last post by:
Hi, I've developed a testing application that stores formatted results in a database. Recently it was requested that I add the ability to generate graphs from the raw, un formatted test results (100,000+ float values) I don't intend to store all of the 100,000 datapoints, but rather a subset of say 250. Due to the volume of testing that we need and the volume of results stored, I need to be VERY careful with data size and keep things...
8
14169
by: d major | last post by:
I was very puzzled about the conversion between float and long, I cann't understand why a long val can convert to a float, as the below codes show: typedef unsigned long u_long; float val = 3.14159; u_long nw_val = *((u_long *) &val); than the nw_val equal to 1078530000, I made such conversion: float d_val = *((float*)&nw_val);
1
6796
by: spoonybard | last post by:
Hi Everyone, I have a tableless website design and I am trying to add the feature to print the middle column content on one of my pages. The information that is being displayed is a two column layout with a float left and a float right. When I view the page in Print Preview, the float right column breaks to the next line. I haven't been able to come up with a viable solution for this problem. I've tried creating my own stylesheet for...
2
3895
by: Jim Carlock | last post by:
I ran into a problem a think. Either that or I overlooked something. I seem to run into this problem quite often. I fail to pinpoint the problem and it appears as a bug with mozilla browsers. Anyone willing to offer a hint or suggestion as to why the outer container retains the width of the inner container, instead of auto-clearing both sides and instead of growing to the size of the container holding everything? <div id="container"><!--...
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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
10239
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
10190
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,...
0
9057
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
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
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
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
2
3736
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.