473,394 Members | 2,160 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,394 software developers and data experts.

container's not expanding

Hello:

I'm relatively new to CSS, and I'm doing a site where I don't want to
use any tables.

I've gotten pretty far, and the site has the layout I want. My only
problem is that I'm using the flot positional paremter a lot on
containers, and it really seems to do what I want. Except when I put
other containers in these containers, they don't expand vertically
like I want. Here's the stylesheet:

/* ****** CONTAINERS ******* */

#container
{
margin: 0 auto;
width: 1000px;
padding: 0 10px 0 10px;
text-align: left;
position: relative;
border: 1px solid red;
}

* html #container
{
width: 1024px;
margin: 0 auto;
position: relative;
border: 1px solid black;
}

#container #header
{
position: relative;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
margin-top: 10px;
width: 1000px;
height: 80px;
border: 1px solid black;
}

#container #header #leftHeader
{
position: relative;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 800px;
height: 80px;
}

#container #header #acctManagement
{
position: absolute;
top: 0px;
left: 800px;
right: 0px;
bottom: 0px;
width: 200px;
height: 80px;
border: 1px solid black;
}

#container #body
{
position: relative;
color: #ffffff;
width: 1000px;
margin-top: 10px;
margin-bottom: 10px;
text-align: right;
padding: 0 0 0 0;
border: 1px solid black;
}

#container #footer
{
position: relative;
color: #ffffff;
height: 25px;
width: 1000px;
margin-top: 10px;
margin-bottom: 10px;
text-align: right;
padding: 0 0 0 0;
border: 1px solid green;
}

#container #center
{
position: absolute;
top: 97px;
left: 205px;
right: 0px;
bottom: 0px;
color: #ffffff;
height: 300px;
width: 495px;
margin-left: 5px;
text-align: right;
border: 1px solid blue;
}

#right
{
position: absolute;
top: 97px;
left: 705px;
right: 0px;
bottom: 0px;
color: #ffffff;
height: 300px;
width: 295px;
margin-left: 10px;
text-align: right;
border: 1px solid blue;
}

#right2
{
float: top;
float: right;
color: #ffffff;
height: 400px;
width: 295px;
margin-left: 10px;
text-align: right;
border: 1px solid blue;
}

#center
{

}

#container #left
{
float: left
color: #ffffff;
width: 190px;
height: 300px;
margin: 5px 5px 5px 0px;
text-align: right;
padding: 0 0 0 0;
border: 1px solid red;
}

And now the file (these are just files i"m working with in order to
get the layout I want:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="stylesheets/
standard.css" />
</head>

<body>
<div id="container">
<div id="header">
<div id="leftHeader"></div>
<div id="acctManagement"></div>
</div>

<div id="container">
<div id="right2"></div>
<div id="left"></div>
</div>

<div id="footer"></div>
</div>

</body>
</html>

What I don't understand is why a container as a float won't
automatically expand. is there another option I shoudl be looking
into?

Thanks very much in advance!

Mike

Apr 13 '07 #1
1 5894
On 2007-04-13, Miked <mi*************@gmail.comwrote:
Hello:

I'm relatively new to CSS, and I'm doing a site where I don't want to
use any tables.

I've gotten pretty far, and the site has the layout I want. My only
problem is that I'm using the flot positional paremter a lot on
containers, and it really seems to do what I want. Except when I put
other containers in these containers, they don't expand vertically
like I want.
That is the correct behaviour.

[...]
What I don't understand is why a container as a float won't
automatically expand.
If you were using floats to embed figures in paragraphs of text, rather
than to make general purpose column-like containers, you wouldn't want
the paragraph the float started in to extend past the bottom of the
float leaving a gap before the start of the next paragraph. That's why
floats behave the way they do.
is there another option I should be looking into?
The easiest fix in this case is to add "overflow: hidden" to #container.
That makes #container a "block formatting context root", and computed
values of auto heights for block formatting context roots _do_ include
floating descendents after all.

The other approach is to put something in #container with clear:both set
on it. It will be positioned vertically after the floats (to "clear"
them) and therefore establish #container's height. <div
style="clear:both"></divshould work (although IIRC that div might need
to contain &nbsp; to kick IE into action).

By the way, you have two elements with the same id which is bad, use
class instead, and always use the strict DOCTYPE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
Apr 13 '07 #2

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

Similar topics

1
by: Jeffrey Kilpatrick | last post by:
I have a SQL 6.5 database that we parse some data into everyday using an access program. All this was devises and setup by a programmer that I can't get in contact with anymore and it has actually...
4
by: David | last post by:
It's sad to say, but when using the AOL web site, like to send an email, they have a nifty capability such that when a window is resized, the textarea where the message is input expands not only...
4
by: erikd | last post by:
I'm using an expanding tree menu based on the design from Dieter Bungers GMD (www.gmd.de) and infovation (www.infovation.de) named displayToc.js. The problem is that the script isn't working...
2
by: weston | last post by:
So, I'm attempting to code an expanding tree menu, based off of unordered lists containing unordered lists. I'm also trying to do it in such a way that none of the javascript has to go inline with...
1
by: Bhiksha Raj | last post by:
Hi, I created an expanding menu on one of the frames in my webpage using code I got from http://www.dynamicdrive.com/dynamicindex1/navigate1.htm I have embedded the code (with minor...
3
by: jignesh shah | last post by:
Hi all, Is there a way to recover a single container if its been corrupted or mark bad without restoring whole tablespace? environment: db28.1/aix5.1/tsm/rs-6000. Regards Jignesh
6
by: Jack | last post by:
Hello, I would like some advice on how to disable the behavior of treeviews to expand and collapse when double clicked upon, but still allow the user to use the plus and minus on each node. ...
13
Chrisjc
by: Chrisjc | last post by:
I am in need of an expanding and collapsing code… The goal is To be able to click a PICTURE IMAGE and expand to show information Reason for this is I have 3 TABLES of information of about ...
7
by: AndrewMcLellan | last post by:
Hello there, hoping for a little hand with my problem here..... I have a HTML and CSS page I'm creating and the container div (the outer blue div) does not expand. I have a maincontent div inside...
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:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.