2 replies [Last post]
trond.rud
Offline
Enthusiast
Last seen: 15 years 24 weeks ago
Joined: 2006-03-15
Posts: 64
Points: 0

I have made a fluid layout: http://mytest.com.85.seekdotnet.com/2col.html

I have been told it is wiser to make the leftnav div be a fixed width rather then like it is now. But I must still have a fluid layout, but I guess only the content div actually needs width set in precentage.

1: What would be best value to use for the width of leftnav; em or px?

2: How will I get the #content div to take of the rest of the space inside the wrapper or pagewidth div? Without any overlapping? (After changing values to the leftnav)

This is the css:

#content{
float: left;
width:79.5%;
margin-left: 20%;
background-color: #A0AFCB;
border-left: .3em #fff solid;}

#leftnav{
float: left;
width: 20%;
margin-left: -100.3%;
background-color: #b7c9e9;}

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 46 weeks 6 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Fixung 1 column in liquid page

Note: duplicate query removed.

In my 2 column demo, change the width of #wrapper to some % value. That will give you exactly what you ask.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

trond.rud
Offline
Enthusiast
Last seen: 15 years 24 weeks ago
Joined: 2006-03-15
Posts: 64
Points: 0

kk5st wrote:Note: duplicate

kk5st wrote:
Note: duplicate query removed.

In my 2 column demo, change the width of #wrapper to some % value. That will give you exactly what you ask.

cheers,

gary

As I view your example I see that you have not put a width of the main.
So all I need to do is remove the width from my content div?
I was sure not setting a width value would cause odd behavior in many browsers but maybe not?

Trying to make those changes to my css, now it is displayed in another way. With a slightly margin to the right of content, and with too much space between the two columns. So I put the margin-left for content to 199px, 1 pixel less then the width of the leftnav, and that took care of IE 6.x. IE displays it correct now, but I do have some spacing in FF to the right. It appears to be as much of spacing as I have width to the white boarders.

I guess I will need to study your example more thoughrouly tomorrow. It is now 3.30 in the morning, and my coffee mug is empty.

Viewing your example closer I see that you have not the same order as I have in the divs, maybe then I can not use yours? Mine are maincontent then leftnav, your is the other way around.