2 Colum Layout

J

John Tennan

Hi,

Have run into a little difficulty. I want to create a 2 colum layout within
a box that is centered. The box is 80% width. The left colum is 200px. The
right colum needs to be dynamic; to fill the rest of the box, but also not
to spill underneath the left colum when the left colum is completed. IE
works okay to leave width off when defining style for right colum, however,
Netscape reacts by forcing the right colum to begin underneath the left
colum (if the left colum divs were created before). I'm using floats at the
moment, but have tried positioning, but makes more complicated and seems
less stable.

If anybody has any ideas on how to achieve this that would be greatly
appreciated. Many thanks in advance.

Cheers John.

Example code is below.

<style>
#box {
width: 80%;
border: 1px solid #CCCCCC;
}
#left_col {
width: 200px;
float: left;
background-color: #0000FF;
}
#right_col {
float: right;
background-color: #FF0000;
}
</style>
</head>
<body>
<center>
<div id="box">
<div id="left_col">Test</div>
<div id="right_col">
<p>Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test
Test Test Test Test</p>
</div>
<div style="clear: both;"></div>
</center>
</div>
</body>
 
D

dorayme

"John Tennan said:
Hi,

Have run into a little difficulty. I want to create a 2 colum layout within
a box that is centered. The box is 80% width. The left colum is 200px. The
right colum needs to be dynamic; to fill the rest of the box, but also not
to spill underneath the left colum when the left colum is completed. IE
works okay to leave width off when defining style for right colum, however,
Netscape reacts by forcing the right colum to begin underneath the left
colum (if the left colum divs were created before). I'm using floats at the
moment, but have tried positioning, but makes more complicated and seems
less stable.

If anybody has any ideas on how to achieve this that would be greatly
appreciated. Many thanks in advance.

Cheers John.

Example code is below.

You could look at some cleaner code I knocked up for you to do
this sort of thing at

http://members.optusnet.com.au/droovies/test/test4.html

and if there are probs, ask here and someone will deepen your
knowledge... It is a tricky business handling the float bugs in
IE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top