473,662 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

float with set width forces outer container to width of inner container

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"> <!-- container -->

....

<div><!-- outer_container -->
<!-- http://google2.fda.gov/search?q=canola -->
<div style="width:50 0px;float:left; margin:1.25em auto;border:1px #AA0000 solid;padding:1 .25em;clear:bot h;">
<form action="http://google2.fda.gov/search" method="get">
<p>Please enter what you want to find at the F.D.A. Type <i>canola</ior <i>rapeseed</iinto the text box below.</p>
<p class="pc"><b>E nter Words</b>: <input type="text" name="q" style="width:30 0px;" /><br />
<input type="submit" value="Submit" /></p></form>
</div><!-- outer_container --></div>

....

<!-- container --></div>

I tried the following styles for the outer_container :

<div style="width:10 0%;"><!-- outer_container -->
<div style="width:au to;"><!-- outer_container -->

I must be missing out on something...

microcosmotalk dot com/live/health/canola/#canola_more_in formation

Thanks for any help that comes my way.

--
Jim Carlock
You Have More Than Five Senses
http://www.associatedcontent.com/art...ve_senses.html

Sep 20 '08 #1
2 3890
Jim Carlock wrote:
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.
No, Mozilla is getting it right, but I assume you think IE is correct
here. Floats are *not* contained by their static parents. Now what we
don't have here is a URL! (Seems like a broken record, but there maybe
factors which are not included in your snippet like Do you have a
Doctype? Does the page trigger quirks mode in IE?)
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?
It isn't, the outer_container will be as wide as #container if you add a
border to it your will see that it will look like a "line" the width of
#container- and margins or padding. What you will also note is it
will *not* look like a box containing the floating child DIV.

>
<div id="container"> <!-- container -->

...

<div><!-- outer_container -->
<!-- http://google2.fda.gov/search?q=canola -->
<div style="width:50 0px;float:left; margin:1.25em auto;border:1px #AA0000 solid;padding:1 .25em;clear:bot h;">
<form action="http://google2.fda.gov/search" method="get">
<p>Please enter what you want to find at the F.D.A. Type <i>canola</ior <i>rapeseed</iinto the text box below.</p>
<p class="pc"><b>E nter Words</b>: <input type="text" name="q" style="width:30 0px;" /><br />
<input type="submit" value="Submit" /></p></form>
Add a clearing element here to keep float from breaking out of the
bottom of "outer_containe r"
</div><!-- outer_container --></div>

...

<!-- container --></div>

I tried the following styles for the outer_container :

<div style="width:10 0%;"><!-- outer_container -->
<div style="width:au to;"><!-- outer_container -->
Or add <div style="overflow : hidden;"><!-- outer_container -->
to get outer_container to "contain" the float. See

http://www.quirksmode.org/css/clearing.html
CSS - Clearing floats

for more on the subject.
>
I must be missing out on something...

microcosmotalk dot com/live/health/canola/#canola_more_in formation
Oh, is this the page? TIP: learn what an external stylesheet is...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Sep 20 '08 #2
In article <48************ **********@unli mited.newshosti ng.com>,
"Jim Carlock" <jc******@127.0 .0.1wrote:
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?
<http://netweaver.com.a u/floatHouse/>

--
dorayme
Sep 21 '08 #3

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

Similar topics

3
4930
by: trialproduct2004 | last post by:
hi all i am having application which is using two classes. in one class i am creating instance of another class and calling method of that class. what i want is from inner class's method i want to invoke method of outer class. can i use delegates to do this. any help will be appreciated. thanks in advance.
4
2260
by: Newbie | last post by:
I need to iterate through all the cells in an HTML-like table, e.g. <for-each select="tr"> <for-each select="td"> Get coordinates of cell here </for-each> </for-each> How can I access my position in the outer loop from within the inner loop?
0
994
dmjpro
by: dmjpro | last post by:
is there any difference between web-container and servlet container as the web-server and application server???? any help is most welcome...
0
1528
by: swift2013 | last post by:
I have a paragraph which has width=200px and is contained in a div. The div is placed within the table cell, which has width=50px In IE6, Firefox 2.0.0.6 the div has offsetWidth of 200px, but ie7 renders it with 50px. How can i force ie7 to set div's width by its contents? <style> table.narrowTable tr td { width: 50px;
4
7510
by: Neelesh2007 | last post by:
I am using Datareport in a VB6.0 project with Access as backend. My code work fine with my PC. Also I have installed the project in several other PC's. (I have created setup with Visual Studio Installer 1.1). In some PC's while viewing Datareport it gives Error "Report Width Larger than paper Width" and in some PC's it works fine. Can anybody help me to resolve my problem? Thanks.
0
1811
by: labmonkey111 | last post by:
I'm trying to get a list of page links for a report, and I'm running into a problem with IE. I have a group of nested left-floating DIVs for the page menu, inside a table. Firefox expands the size of the table to see the entire menu, but IE does not, the last few are cut off. After a couple of hours of testing, I have determined that IE is not using the min-width when calculating the width of the DIV, but does use the min-width when displaying...
1
5066
pradeepjain
by: pradeepjain | last post by:
Hii guys, I might be silly to ask this ques..but seriously i did not understand the outer join and inner join in mysql site.i understood left and right join also. can some one explain outer and inner join with some basic definition and example plzz..and also unique key. thanks, Pradeep
0
8343
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
8856
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
8762
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
6185
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
5653
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
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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
1992
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.