Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2008
    Thanked 3 Times in 3 Posts

    fluid sides and fixed main - centered layout?

    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...

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    	<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>
    	<div id="page-wrap">
    		<div id="leftCol" class="clear"></div>
    		<div id="centerCol" class="clear"></div> 
    		<div id="rightCol" class="clear"></div>
    *					{ 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;}

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Thanked 1,845 Times in 1,829 Posts
    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%20cen...ars/index.html
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    ch4sethe5un (05-09-2010)

  • #3
    New Coder
    Join Date
    Jul 2008
    Thanked 3 Times in 3 Posts
    thanks thats actually the application i was looking for!

    I will apply it and see how it goes


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts