...

View Full Version : fluid sides and fixed main - centered layout?



ch4sethe5un
05-09-2010, 03:50 AM
I having a hard time trying to find any examples, but what i want to accomplish is have a three column layout. The center column be centered and fixed width while the left and right columns are liquid and takes up the rest of the browser space that is not taken up by the center column.

I have only seen the other way around where the left/right columns are fixed width and the center is fluid. or some form of this

Does anyone have a direction they can shot me in? and or know how to do this?

here is what i have tried, but i am stuck now... :confused:

html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head profile="http://gmpg.org/xfn/11">
<title>BASIC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex, nofollow" />

<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<script type="text/javascript" src="js/script.js"></script>
</head>

<body>
<div id="page-wrap">
<div id="leftCol" class="clear"></div>

<div id="centerCol" class="clear"></div>

<div id="rightCol" class="clear"></div>

</div>
</body>


</html>


css:


* { margin: 0; padding: 0; }
html, body { height: 100%; color: white; font: 14px Georgia; background-color: #0b0b0b;}
a { text-decoration:none; color:white;}
a img { border: 0; }

#page-wrap { }
.clear { clear:both;}

#leftCol { width: 100%; background:blue; height:100px; float:left;}
#centerCol { margin:0 auto; width:400px; background:green; height: 200px; float:left;}
#rightCol { width: 100%; background:blue; height:100px; float:left;}

Excavator
05-09-2010, 04:21 AM
Hello ch4sethe5un,
I worked up something like that once, so a background image could shrink all the way down to gone as the viewport was narrowed to the width of the center div.
A similar layout might work with actual content in the left/right columns if you used some min-width settings.

Have a look here - http://nopeople.com/CSS/1022px%20center-fluid%20sidebars/index.html

ch4sethe5un
05-09-2010, 06:43 AM
thanks thats actually the application i was looking for! :D

I will apply it and see how it goes



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum