473,513 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

3 colums layout: div positioning

Joy
Hi guys, I am in a tricky situation, I really really hope someone will help
me.

I got a layout with a main container and three colums inside.
Main container: 100% height; 90% width; float: left
First colum: 100% height; 200px width; float: left
Second colum: 100% height; 200px width; float: right
Third colum: 100% height

And here I stop, because nothing seems to work in order to set correctly
third colum to take all remaining space inside the main container (I don't
want to make third colum fixed because I want it resizable by resolution).

I have tried many configurations with positioning but didn't solved the
problem.

How can I manage? Is it possible to make it work with 2 fixed and one
resizable colums? Thanks to all.
Jul 20 '05 #1
5 8092
On Mon, 6 Sep 2004 22:40:06 +0200, Joy <jo*@nospam.net> wrote:
Hi guys, I am in a tricky situation, I really really hope someone will
help
me.

I got a layout with a main container and three colums inside.
Main container: 100% height; 90% width; float: left
What are you floating this main container left OF? Float is meant to move
an item to one side and allow the following content to start at the same
vertical position. I don't think you really want to float this container.
But do set position: relative; to make it serve as a containing block.
First colum: 100% height; 200px width; float: left
Second colum: 100% height; 200px width; float: right
Third colum: 100% height

And here I stop, because nothing seems to work in order to set correctly
third colum to take all remaining space inside the main container (I
don't
want to make third colum fixed because I want it resizable by
resolution).

I have tried many configurations with positioning but didn't solved the
problem.

How can I manage? Is it possible to make it work with 2 fixed and one
resizable colums? Thanks to all.


Sure. Make the center column - the one which takes all remaining space -
have left and right margins of 200px. Float the other two left and right
prior to this div, it'll work fine.
Jul 20 '05 #2
Els
Joy wrote:
Hi guys, I am in a tricky situation, I really really hope
someone will help me.

I got a layout with a main container and three colums
inside. Main container: 100% height; 90% width; float: left
First colum: 100% height; 200px width; float: left
Second colum: 100% height; 200px width; float: right
Third colum: 100% height

And here I stop, because nothing seems to work in order to
set correctly third colum to take all remaining space
inside the main container (I don't want to make third colum
fixed because I want it resizable by resolution).

I have tried many configurations with positioning but
didn't solved the problem.

How can I manage? Is it possible to make it work with 2
fixed and one resizable colums? Thanks to all.


container: don't float it.
first column: float left
second column: float left
third column: don't float it, give it a left margin of 400px.

This is, assuming that first second and third columns are to
appear in that order.
However, I think you mean the order as 1st, 3rd, 2nd.
I'll rename them for "logicality":

container: don't float it.
left column: float left
right column: float right
middle column: don't float it, give it a left and a right
margin, each 200px :-)

Next problem to solve:
Iirc, the 100% height will mean the background color stops at
the bottom of the viewport, and will leave the rest of the
columns without colouring when scrolling up.
;-)

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 20 '05 #3
On 6 Sep 2004 21:00:53 GMT, Els <el*********@tiscali.nl> wrote:

Next problem to solve:
Iirc, the 100% height will mean the background color stops at
the bottom of the viewport, and will leave the rest of the
columns without colouring when scrolling up.
;-)


Best way I know of to solve this little dilemma is to set, on the center
column:

border-right: 200px solid #ccc;
border-left: 200px solid #ccc;

instead of margins. Since the floated element will not match the height of
the center one, this is the only sure way to give that illusion.

Another cumbersome way is to use two containing divs nested. Set one with
a background image 1px high by 200px wide, set it left and repeat-y. This
is the background image for the left column. Repeat with the other div
except set it to the right. This can only work with pixel-width columns,
which as we all know by now can pose problems when users need to resize
text.

Jul 20 '05 #4
Els
Neal wrote:
On 6 Sep 2004 21:00:53 GMT, Els <el*********@tiscali.nl>
wrote:

Next problem to solve:
Iirc, the 100% height will mean the background color stops
at the bottom of the viewport, and will leave the rest of
the columns without colouring when scrolling up.
;-)
Best way I know of to solve this little dilemma is to set,
on the center column:

border-right: 200px solid #ccc;
border-left: 200px solid #ccc;

instead of margins. Since the floated element will not
match the height of the center one, this is the only sure
way to give that illusion.


Unless the floated div(s) are higher than the middle column.
And I haven't tried it, but would you not need a z-index on
the floats to make them cover the borders of the center
column?
Another cumbersome way is to use two containing divs
nested. Set one with a background image 1px high by 200px
wide, set it left and repeat-y. This is the background
image for the left column. Repeat with the other div except
set it to the right. This can only work with pixel-width
columns, which as we all know by now can pose problems when
users need to resize text.


If one of the two side columns would be fixed (maybe for
pictures?) then the other one could be in ems or percentage.
Have the background-image of the flexible one in the outer
container div, set to "repeat", and the one of the fixed
column in the inner container div, set to "repeat-y".

Which only works as long as the center content is longer than
the flexible side content, or if it doesn't matter that the
colour goes below that center content.

But of course there still is the possibility of all three
columns having the same background colour ;-)

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 20 '05 #5
On 6 Sep 2004 22:14:05 GMT, Els <el*********@tiscali.nl> wrote:
Neal wrote:
border-right: 200px solid #ccc;
border-left: 200px solid #ccc; Unless the floated div(s) are higher than the middle column.


True - though this is rare, it is a limitation.
And I haven't tried it, but would you not need a z-index on
the floats to make them cover the borders of the center
column?


Nope, no need. The float will go over the border.
Jul 20 '05 #6

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

Similar topics

82
10594
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | ...
39
5622
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
7
2724
by: James Thornton | last post by:
I'm trying to make the transition from tables to CSS, and I need someone to explain how to achieve the following layout (understanding the concepts behind this layout will help me considerably in...
47
9077
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
4
2337
by: NWx | last post by:
Hi, I develop an ASP.NET app which should be used from Internet, so I don't have control over what browsers will be used. I don't want to target every possible users, so I don't really mind is...
3
2350
by: Dave | last post by:
I am designing a web page using VS2003 ASP.NET. The page contains various DIVs (panels), one of which is in grid layout. The controls in this DIV render correctly in IE, but when using Firefox they...
3
1531
by: Samuel Shulman | last post by:
I am looking for good guidance for positioning controls on the form.document, it is absolute nightmare and I don't know where to begin Thank you, Samuel Shulman
14
4815
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
53
4064
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
0
7384
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
7537
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...
1
7099
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...
1
5086
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
4746
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...
0
3233
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
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
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 ...
1
799
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.