Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS & Firefox

Status
Not open for further replies.

kconmle

Programmer
Oct 20, 2009
18
US
I am having an issue where I have a table in a div... When the table grows longer than the div the div does not expand in FF... works fine in IE - what do I need to do to have the div expand with the table?
 
Here is what the code looks like:

<div id="container">
<div class="content">
<table>... has no css</table>
</div>
</div>


#container {
margin-left:auto;
margin-right:auto;
width:95%;
height:75%;
opacity:.75;
filter:alpha(opacity=75);
border:1px solid #ffffff;
}

.content {
position:relative;
float:left;
height:100%;
width:75%;
}
 
That is meant to give it a minimum height... when I take the height out - then it has not height - which I think goes back to the same problem... I want the stuff in the container div to give it its height...
 
It's because the inner div is floated - doing that takes the div out of the document flow, so the outer div doesn't (by default) expand to contain it.

Try adding [tt]overflow:auto[/tt] to div#container (or remove the float from div.content, since it doesn't appear to do anything useful).

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
taking out the float in content had no affect (as you said...) putting overflow:auto did nothing in FF and in IE it kept the height at 75% and put in scrollbars (before it was expanding the div to fit...)
 
right - I know, but once I can get them properly nested - I should not need either....
 
I found a solution - my code was fine (still did not need the float:left) but my doctype declaration was wrong... I corrected that to transitional and it is fine in both...
 
If what you showed us is your entire code, then there's actually no need for the .content div at all. It seems that you have changed from a valid doctype to an invalid one, because rendering usually does not change between two different valid doctypes.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top