I am working on a 3 column layout for a website, it also has a header and a footer. In the middle of the header and footer are the 3 columns, 2 side columns (right and left) and a center column. Now both side columns and the header and foot work fine and how I want them but the center column does not. I want the center column to add scroll bars when it gets too long (when the bottom meets the same height as the side columns) however all it does is stretch the center column.
I have tried many ways of solving this switching from Framesets, Table, Div, CSS+Div, CSS+Div+Table, CSS+Table, CSS+Framesets+Div, CSS+Framesets+Table, Frameset+Table, Framesets+Div etc. But it all resulted in the same error or a different one. (layout disordered)
I remember a while ago that I had done the same thing so simply but for some reason I can not get it to work now. Hopefully I am just overlooking something.
I have viewed the site on Firefox, Google Chrome, and IE8.
I have used various code but I will post up the last one I used and hopefully someone can help.
HTML
CODE
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Layout testing</title>
<link rel="stylesheet" type="text/css" href="styles.css" media="screen" />
</head>
<body>
<div class="header">
<!-- Header start -->
<img src="images/Header2.png">
<!-- Header end -->
</div>
<!-- Columns start -->
<div class="colmask threecol">
<div class="colmid">
<div class="colleft">
<div class="col1" style="background:images/Interrior2.png">
<!-- Column 1 (Center) start -->
<div style="height:20%;">
<center>
<a href="temp.html">About Us</a> | <a href="temp.html">
News</a> | <a href="temp.html">Articles</a> | <a href="temp.html">
Videos</a> | <a href="temp.html">Behind Scenes</a> | <a href="temp.html">
Media</a> | <a href="temp.html">Lifestyles</a> | <a href="temp.html">
Store</a>
</center>
</div>
<center>
Main content will go here.<br>
<font face="courier new" size="5">
╓────────────╨╨────────────╖<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
╙──────────────────────────╜<br>
</font>
More Content Here.<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
</center>
<!-- Column 1 (Center) end -->
</div>
<div class="col2">
<!-- Column 2 (Left) start -->
<img src=images/LeftSide2.png>
<!-- Column 2 (Left) end -->
</div>
<div class="col3">
<!-- Column 3 (Right) start -->
<img src=images/RightSide2.png>
<!-- Column 3 (Right) end -->
</div>
</div>
</div>
</div>
<!-- Columns end -->
<div class="footer">
<!-- Footer start -->
<img src=images/Footer2.png>
<!-- Footer end -->
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Layout testing</title>
<link rel="stylesheet" type="text/css" href="styles.css" media="screen" />
</head>
<body>
<div class="header">
<!-- Header start -->
<img src="images/Header2.png">
<!-- Header end -->
</div>
<!-- Columns start -->
<div class="colmask threecol">
<div class="colmid">
<div class="colleft">
<div class="col1" style="background:images/Interrior2.png">
<!-- Column 1 (Center) start -->
<div style="height:20%;">
<center>
<a href="temp.html">About Us</a> | <a href="temp.html">
News</a> | <a href="temp.html">Articles</a> | <a href="temp.html">
Videos</a> | <a href="temp.html">Behind Scenes</a> | <a href="temp.html">
Media</a> | <a href="temp.html">Lifestyles</a> | <a href="temp.html">
Store</a>
</center>
</div>
<center>
Main content will go here.<br>
<font face="courier new" size="5">
╓────────────╨╨────────────╖<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
║ ║<br>
╙──────────────────────────╜<br>
</font>
More Content Here.<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
And Here...<br>
</center>
<!-- Column 1 (Center) end -->
</div>
<div class="col2">
<!-- Column 2 (Left) start -->
<img src=images/LeftSide2.png>
<!-- Column 2 (Left) end -->
</div>
<div class="col3">
<!-- Column 3 (Right) start -->
<img src=images/RightSide2.png>
<!-- Column 3 (Right) end -->
</div>
</div>
</div>
</div>
<!-- Columns end -->
<div class="footer">
<!-- Footer start -->
<img src=images/Footer2.png>
<!-- Footer end -->
</div>
</body>
</html>
CSS
CODE
/* <!-- */
/* General styles */
body {
margin:0;
padding:0;
border:0; /* This removes the border around the viewport in old versions of IE */
width:100%;
background:#fff;
min-width:600px; /* Minimum width of layout - remove line if not required */
/* The min-width property does not work in old versions of Internet Explorer */
font-size:90%;
}
/* Header styles */
#header {
clear:both;
float:left;
width:100%;
margin:0;
padding:0;
border:0;
}
#header p {
padding:0 0 0 0;
margin:0;
}
#header h1,
#header h2 {
padding:0 0 0 0;
margin:0;
}
#header ul {
clear:left;
float:left;
width:100%;
list-style:none;
margin:0 0 0 0;
padding:0;
}
#header ul li {
display:inline;
list-style:none;
margin:0;
padding:0;
}
#header ul li a {
display:block;
float:left;
margin:0 0 0 0;
padding:0 0;
text-align:center;
background:#eee;
color:#000;
text-decoration:none;
position:relative;
left:0px;
line-height:0em;
}
#header ul li a:hover {
background:#369;
color:#fff;
}
#header ul li a.active,
#header ul li a.active:hover {
color:#fff;
background:#000;
font-weight:bold;
}
#header ul li a span {
display:block;
}
/* 'widths' sub menu */
#layoutdims {
clear:both;
background:#eee;
border-top:0 solid #000;
margin:0;
padding:6px 15px !important;
text-align:right;
}
/* column container */
.colmask {
position:relative; /* This fixes the IE7 overflow hidden bug */
clear:both;
float:left;
width:100%; /* width of whole page */
overflow:hidden; /* This chops off any overhanging divs */
}
/* common column settings */
.colright,
.colmid,
.colleft {
float:left;
width:100%; /* width of page */
position:relative;
}
.col1,
.col2,
.col3 {
float:left;
position:relative;
padding:0 0 0 0; /* no left and right padding on columns, we just make them narrower instead
only padding top and bottom is included here, make it whatever value you need */
overflow:hidden;
}
/* 3 Column settings */
.threecol {
background:#fff; /* right column background colour */
}
.threecol .colmid {
right:15%; /* width of the right column */
background:#fff; /* center column background colour */
}
.threecol .colleft {
right:70%; /* width of the middle column */
background:#fff; /* left column background colour */
}
.threecol .col1 {
width:70%; /* width of center column content (column width minus padding on either side) */
left:100%; /* 100% plus left padding of center column */
}
.threecol .col2 {
width:15%; /* Width of left column content (column width minus padding on either side) */
left:15%; /* width of (right column) plus (center column left and right padding) plus (left column left padding) */
}
.threecol .col3 {
width:15%; /* Width of right column content (column width minus padding on either side) */
left:85%; /* Please make note of the brackets here:
(100% - left column width) plus (center column left and right padding) plus
(left column left and right padding) plus (right column left padding) */
}
/* Footer styles */
#footer {
clear:both;
float:left;
width:100%;
}
#footer p {
padding:0px;
margin:0;
}
/* Navigation Bar styles */
#navbar {
clear:both;
float:left;
width:100%;
text-align:center;
}
/* Page Body styles */
#bmain {
clear:both;
float:left;
width:100%;
}
/* --> */
/* General styles */
body {
margin:0;
padding:0;
border:0; /* This removes the border around the viewport in old versions of IE */
width:100%;
background:#fff;
min-width:600px; /* Minimum width of layout - remove line if not required */
/* The min-width property does not work in old versions of Internet Explorer */
font-size:90%;
}
/* Header styles */
#header {
clear:both;
float:left;
width:100%;
margin:0;
padding:0;
border:0;
}
#header p {
padding:0 0 0 0;
margin:0;
}
#header h1,
#header h2 {
padding:0 0 0 0;
margin:0;
}
#header ul {
clear:left;
float:left;
width:100%;
list-style:none;
margin:0 0 0 0;
padding:0;
}
#header ul li {
display:inline;
list-style:none;
margin:0;
padding:0;
}
#header ul li a {
display:block;
float:left;
margin:0 0 0 0;
padding:0 0;
text-align:center;
background:#eee;
color:#000;
text-decoration:none;
position:relative;
left:0px;
line-height:0em;
}
#header ul li a:hover {
background:#369;
color:#fff;
}
#header ul li a.active,
#header ul li a.active:hover {
color:#fff;
background:#000;
font-weight:bold;
}
#header ul li a span {
display:block;
}
/* 'widths' sub menu */
#layoutdims {
clear:both;
background:#eee;
border-top:0 solid #000;
margin:0;
padding:6px 15px !important;
text-align:right;
}
/* column container */
.colmask {
position:relative; /* This fixes the IE7 overflow hidden bug */
clear:both;
float:left;
width:100%; /* width of whole page */
overflow:hidden; /* This chops off any overhanging divs */
}
/* common column settings */
.colright,
.colmid,
.colleft {
float:left;
width:100%; /* width of page */
position:relative;
}
.col1,
.col2,
.col3 {
float:left;
position:relative;
padding:0 0 0 0; /* no left and right padding on columns, we just make them narrower instead
only padding top and bottom is included here, make it whatever value you need */
overflow:hidden;
}
/* 3 Column settings */
.threecol {
background:#fff; /* right column background colour */
}
.threecol .colmid {
right:15%; /* width of the right column */
background:#fff; /* center column background colour */
}
.threecol .colleft {
right:70%; /* width of the middle column */
background:#fff; /* left column background colour */
}
.threecol .col1 {
width:70%; /* width of center column content (column width minus padding on either side) */
left:100%; /* 100% plus left padding of center column */
}
.threecol .col2 {
width:15%; /* Width of left column content (column width minus padding on either side) */
left:15%; /* width of (right column) plus (center column left and right padding) plus (left column left padding) */
}
.threecol .col3 {
width:15%; /* Width of right column content (column width minus padding on either side) */
left:85%; /* Please make note of the brackets here:
(100% - left column width) plus (center column left and right padding) plus
(left column left and right padding) plus (right column left padding) */
}
/* Footer styles */
#footer {
clear:both;
float:left;
width:100%;
}
#footer p {
padding:0px;
margin:0;
}
/* Navigation Bar styles */
#navbar {
clear:both;
float:left;
width:100%;
text-align:center;
}
/* Page Body styles */
#bmain {
clear:both;
float:left;
width:100%;
}
/* --> */
I had also looked on here and searched around here and other sites and modified/replaced my code trying to get it to work so now its not much near what I started with.
Thanks in advance.
