1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help: CSS Three Columns

Discussion in 'CSS' started by SuperScott, Oct 16, 2005.

  1. #1
    I was having a problem creating three columns without using tables. Particularly three columns where the two outside columns were a fixed width, and the middle column varied based on the size of the browser window. Has anyone done this, or know where I can find the resolution to this?

    ~~
    Scott
    SEMrush
     
    SuperScott, Oct 16, 2005 IP
    SEMrush
  2. saintdw

    saintdw Peon

    Messages:
    453
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes! Here's the code for it.

    
    #top {
    	margin: 20px 20px 0px 20px;
    	padding: 0px;
    	border-top:1px solid #000;
    	border-left:1px solid #000;
    	border-right:1px solid #000;
    	border-bottom:1px solid #000;
    	background: #FFFFFF;
    	height: 70px; /* ie5win fudge begins */
    	voice-family: "\"}\"";
    	voice-family: inherit;
    	height: 70px;
    	}
    html>body #top {
    	height: 70px; /* ie5win fudge ends */
    	}
    
    #left {
    	font-size: 12px;
    	position: absolute;
    	top: 101px;
    	left: 20px;
    	padding: 0px;
    	border-top: 1px solid #000000;
    	border-bottom: 1px solid #000000;
    	border-left: 1px solid #000000;
    	border-right: 1px solid #000000;
    	height: 620px;
    	background: #FFFFFF;
    	width: 146px; /* ie5win fudge begins */
    	voice-family: "\"}\"";
    	voice-family:inherit;
    	width: 146px;
    	}
    html>body #left {
    	width: 146px; /* ie5win fudge ends */
    	}
    
    
    #content{
    	font-size: 12px;
    	margin: 10px 171px 10px 176px;
    	padding: 10px;
    	border-top: 1px solid #000000;
    	border-bottom: 1px solid #000000;
    	border-left: 1px solid #000000;
    	border-right: 1px solid #000000;
    	height: auto;
    	background: #FFFFFF;
    	}	
    
    #right {
    	font-size: 12px;
    	position: absolute;
    	top: 101px;
    	right: 20px; /* Opera5.02 will show a space at right when there is no scroll bar */
    	height: auto;
    	padding: 10px;
    	border: 1px solid #000000;
    	background: #FFFFFF;
    	width: 120px; /* ie5win fudge begins */
    	voice-family: "\"}\"";
    	voice-family:inherit;
    	width: 120px;
    	}
    html>body #right {
    	width: 120px; /* ie5win fudge ends */
    	}
    
    Code (markup):
    BTW, this is a tested code, it works in IE, FF and Opera, I use it on one of my websites.

    3 column Layout with a Header.
     
    saintdw, Oct 16, 2005 IP
  3. Acer

    Acer Well-Known Member

    Messages:
    112
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    133
    #3
    Very nice, saintdw!
     
    Acer, Oct 16, 2005 IP