473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Strange cross linking of div heights.

Earlier in the week I posted a problem with the height of a div in the
first row of a table I was constructing using tapestry as an the engine
generating the html. This problem was across a range of browsers.

Nobody was able to help me because I couldn't post a URL

I have managed to isolate the problem in some static html, but I don't
understand why it occurs.

The following two url's illustrate it.

http://www.chandlerfamily.org.uk/famtree/test.html

shows what I am trying to achieve, but without a left hand panel.

Adding in the left hand panel somehow interacts with an internal div of
the right hand panel - see

http://www.chandlerfamily.org.uk/famtree/test2.html

which shows the bottom of the nested internal div (of class "spouse")
somehow interacting with the bottom of div #menuapps.

This is causing the first div of class spouse to somehow be extended.

The only possible linkage that I can see is through the clearfix class,
but I don't understand why. Can someone give me an explanation so that
I can have a clue as how to avoid it.

Thanks.

(css is at http://www.chandlerfamily.org.uk/famtree/chandler.css )

Sep 16 '05 #1
4 1252
Alan Chandler wrote:

I have managed to isolate the problem in some static html, but I don't
understand why it occurs.

The "clearfix" class did not really address the problem. Remove all of
the "clearfix" classes. They are useless for your example.
The difficulty you are having is that you float:left nearly everything
in a "family" div, leaving the div with essentially no content. Thus the
div height collapses to a minimum value determined by padding and margin.
The same thing occurs for non-floated divs that do not have any content.

Add   to each div that does not have any content besides other
floated divs, or non-floated divs (e.g., "children") with no content.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sep 17 '05 #2
Jim Moe wrote:
Alan Chandler wrote:

I have managed to isolate the problem in some static html, but I don't
understand why it occurs.

The "clearfix" class did not really address the problem. Remove all of
the "clearfix" classes. They are useless for your example.
The difficulty you are having is that you float:left nearly everything
in a "family" div, leaving the div with essentially no content. Thus the
div height collapses to a minimum value determined by padding and
margin. The same thing occurs for non-floated divs that do not have any
content.

Add   to each div that does not have any content besides other
floated divs, or non-floated divs (e.g., "children") with no content.


I actually managed to get a css solution from another mailing list. The
issue is the .clearfix:after selectors clear:both property. Apparently
(I don't understand why - but it works) adding an overflow: property
solves it. I am trying to get a fuller explanation from that list.

But I take your point. I originally put the clearfix solution in as a
matter of principal - but its proving more trouble that its worth, and
essentially making my css extremely difficult to understand. I think I
will try and add the padding in via &nbsp in the code as you suggest.
Sep 17 '05 #3
Alan Chandler wrote:
Jim Moe wrote:


Add   to each div that does not have any content besides other
floated divs, or non-floated divs (e.g., "children") with no content.


I actually managed to get a css solution from another mailing list. The
issue is the .clearfix:after selectors clear:both property. Apparently
(I don't understand why - but it works) adding an overflow: property
solves it. I am trying to get a fuller explanation from that list.

But I take your point. I originally put the clearfix solution in as a
matter of principal - but its proving more trouble that its worth, and
essentially making my css extremely difficult to understand. I think I
will try and add the padding in via &nbsp in the code as you suggest.


Unfortunately it doesn't work.

The embedded floating divs sometimes wordwrap (depends on browser window
width) and get a height that is greater than one line. The   only
makes the surrounding div one line high, which in these cases is not enough.

I am still going to have to put a clear property in somehow.
Sep 17 '05 #4
Alan Chandler wrote:

Unfortunately it doesn't work.

The embedded floating divs sometimes wordwrap (depends on browser window
width) and get a height that is greater than one line. The   only
makes the surrounding div one line high, which in these cases is not
enough.

Because many, but not all, of the divs are floated, you are going to
have this problem; a div without actual content always collapses. Attempts
to work around it only aggravates the problem and creates a maintenance
nightmare.
You are displaying tabular data. Is there some reason why you are not
using tables?

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sep 17 '05 #5

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

Similar topics

14
by: smilesinblues | last post by:
Hi all, I have a table with a lot of songs. All songs have a field called hits. Everytime a song page is seen hits becomes hit++, everything smooth going. I also have a page where I run the...
34
by: Marian Aldenhövel | last post by:
Hi, I am in the process of embarking on building a large web application. I wanted to seize that opportunity to learn how to use CSS and get rid of my ad-hoc approach to HTML-coding (i.e.: add...
7
by: Daniel Jung | last post by:
Hi ======== Problem: ======== I want images in table rows connect vertically. All images are 32 px in height. =====
0
by: Ryan Mack | last post by:
I'm doing development on an embedded system using a GCC 2.96 MIPS cross compiler and a minimal C standard library replacement. The system loads at startup a base executable. The base executable...
5
by: Arnab Nandi | last post by:
We are using the Sun Workshop 6 C++ compiler to compile some CPP files. The command line looks like follows: - CC -g -xsb -c -o output/x.o x.cpp We get the following error: - CC: language...
7
by: lauren quantrell | last post by:
A while back I got a requirement for the client to be able to adjust the relative heights of two subforms by click-dragging the mouse and I came up with a kludge solution using a border control...
35
by: Alex Martelli | last post by:
Having fixed a memory leak (not the leak of a Python reference, some other stuff I wasn't properly freeing in certain cases) in a C-coded extension I maintain, I need a way to test that the leak is...
2
by: xmlizer | last post by:
Hello With this sample of HTML Code, I have a strange behavior in IE (which i haven't in Firefox) It make as it doesn't care about the the heights positionned I positionned them as...
6
by: brandon.e.taylor | last post by:
I am looking for a tool capable of producing HTML pages from source files written in different languages, where the source written in one language is a port of the source written in another...
3
by: Bob Palank | last post by:
This is an issue for someone much wiser than I - perhaps a MVP will help? I color coded the following for readability. Running XP Pro and VC++.Net Express 2008 and vtk visualization software In...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.