473,473 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Simple box prob

Once again:

I have a 'background' div with two inline divs in it, 'menu' and 'content'.

like this:

<div id="background">
<div id="menu"><!-- menu contents of 15-20 lines --> </div>
<div id="content"><!-- text contents of 15-20 lines --> </div>
</div>
How would you ensure that the background box 'stretches' to accomodate
both?

ATM my content does stretch the background, but if it only contains a few
lines of text, the menu is 'taller' and flows tight outside the background
box.
jp
Jul 21 '05 #1
2 1680

Jam Pa wrote:
I have a 'background' div with two inline divs in it, 'menu' and 'content'.
like this:

<div id="background">
<div id="menu"><!-- menu contents of 15-20 lines --> </div>
<div id="content"><!-- text contents of 15-20 lines --> </div>
</div>
How would you ensure that the background box 'stretches' to accomodate both?


Presumably your menu is left floated?

Make sure that you have an element with clear: left set after the end
of both the content and the menu but before the end background box.

Steve

Jul 21 '05 #2
"Jam Pa" <an******@non-anon.org> wrote in message
news:Xn**********************************@213.243. 153.2...
Once again:

I have a 'background' div with two inline divs in it, 'menu' and
'content'.

like this:

<div id="background">
<div id="menu"><!-- menu contents of 15-20 lines --> </div>
<div id="content"><!-- text contents of 15-20 lines --> </div>
</div>
How would you ensure that the background box 'stretches' to accomodate
both?

ATM my content does stretch the background, but if it only contains a few
lines of text, the menu is 'taller' and flows tight outside the background
box.


I recently had the same problem. I wound up with these settings:

div.middlerow { position:relative; width:100%; height:100%; display:inline }

div.leftcolumn { width:15%; height:100%; vertical-align:top; display:inline;
position:relative }

div.centercolumn{ width:65%; height:100%; display:inline;
vertical-align:top; position:relative }

div.rightcolumn { width:20%; height:100%; display:inline;
vertical-align:top; position:relative }

Then in the document:

<div class="middlerow">
<div class="leftcolumn><!--stuff here--></div>
<div class="centercolumn><!--stuff here--></div>
<div class="rightcolumn><!--stuff here--></div>
</div>

I don't know if that's the best solution, but it worked. The three middle
columns always remain the same height relative to each other.
Jul 21 '05 #3

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

Similar topics

6
by: josephrthomas | last post by:
hi..i am trying to make a login page and i am using access table.. when the user enters his userid and password i want to check the password from the table.. if any user with the userID that is...
29
by: Thomas | last post by:
Hi I have an XSL stylesheet: <xsl:for-each select="TRACKS/TRACK"> <tr class="TDL"> <td width="90%"><xsl:number value="position()" format="1" /> - <xsl:value-of select="TRACKTITLE"/></td>...
5
by: David Sobey | last post by:
Hi Sorry bout this basic prob. Got a file called file.obj. tryna read the first line from it as a string and print it to the screen. getting errors: #include "stdafx.h" #include <stdio.h>...
1
by: James R | last post by:
Ok, I'm new at this and learning as I go, but under extreme pressure from work.. So many bugs and little tricky obsticals have got me very far behind, and this is the latest.. I made a simple...
5
by: Daniel | last post by:
I want to do something really simple. I have a form and a class which handles my network layer The form has an instance of the network class as a member and initialises the network layer. ...
4
by: Armand | last post by:
Hi Guys, I have a set of array that I would like to clear and empty out. Since I am using "Array" not "ArrayList", I have been struggling in finding the solution which is a simple prob for those...
5
by: dotNeter | last post by:
I'm studying the RTTI, and my current work is concern for how to get the self-defined type at runtime, that's exactly what the RTTI does. I mean, in my application, I built several self-defined...
0
by: Greg Corradini | last post by:
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure...
2
by: mnacw | last post by:
Can anybody help me to resolve this prob. i have installed Visual Studio 2005 Professional edition. I am working in VB.Net. When I tried to connect to database it is connected but when i make some...
8
by: Huma123 | last post by:
Hi! My problem is that i cant able to run a simple c program cause of this error... Unable to open include file 'stdio.h' unable to open include file 'conio.h' while these header files r...
0
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,...
0
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...
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
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.