Hello, I've been trying to get a layout going based on a three column layout I found at (http://matthewjamestaylor.com/blog/perfect-3-column.htm), however, I've been having difficulties getting the layout to auto fit when I resize my browser. CSS isn't my forte which is why I'm modifying a layout I found versus going from scratch.

Whenever I resize the browser, I'm losing columns 2 and 3, which seem to disappear while column 1 stays intact. Any ideas? Or is there anything else I could provide?

    body {
    margin:0;
    padding:0;
    border:0;           /* This removes the border around the viewport in old versions of IE */
    width:auto;
    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%;
    position:relative;
}
a {
    color:#369;
    border:none;
    text-decoration:none;
}
a img {
    text-decoration: none;
}
a:hover {
    color:#fff;
    background:#369;
    text-decoration:none;
}

img {
    text-decoration:none;
}
img:hover{
    text-decoration:none;
}
h1, h2, h3 {
    margin:.8em 0 .2em 0;
    padding:0;
}
p {
    margin:.4em 0 .8em 0;
    padding:0;
}
img {
    margin:10px 0 5px;
}
#ads img {
    display:block;
    padding-top:10px;
}

/* Header styles */
#header {
    clear:both;
    float:left;
    width:100%;
}
#header {
    border-bottom:0px solid #000;
}
#header p,
#header h1,
#header h2 {
    padding:.4em 15px 0 15px;
    margin:0;
}
#header ul {
    clear:left;
    float:left;
    width:100%;
    list-style:none;
    margin:10px 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 1px;
    padding:3px 10px;
    text-align:center;
    background:#eee;
    color:#000;
    text-decoration:none;
    position:relative;
    left:15px;
    line-height:1.3em;
}
#header ul li a:hover {
    background:#369;
    color:#fff;
    text-decoration:none;
}
#header ul li a.active,
#header ul li a.active:hover {
    color:#fff;
    background:#fff;
    font-weight:bold;
    text-decoration:none;
}
#header ul li a span {
    display:block;
}
/* 'widths' sub menu */
#layoutdims {
    clear:both;
    background:#000;
    border-top:0px 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;
    text-decoration:none;
}
.col1,
.col2,
.col3 {
    float:left;
    position:relative;
    padding:0 0 1em 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;*/
    text-decoration:none;
}
.col1,
.col2,
.col3 a {
    text-decoration:none;
}
.col1 {
    background-color:#fff;
}
/* 3 Column settings */
.threecol {
    background:#fff;        /* right column background colour */
}
.threecol .colmid {
    right:25%;          /* width of the right column */
    background:#fff;        /* center column background colour */
}
.threecol .colleft {
    right:50%;          /* width of the middle column */
    background:#fff;    /* left column background colour */
}
.threecol .col1 {
    width:46%;          /*46 width of center column content (column width minus padding on either side) */
    left:102%;          /*102 100% plus left padding of center column */
}
.threecol .col2 {
    width:21%;          /*21 Width of left column content (column width minus padding on either side) */
    left:31%;           /*31 width of (right column) plus (center column left and right padding) plus (left column left padding) */
}
.threecol .col3 {
    width:21%;          /*21 Width of right column content (column width minus padding on either side) */
    left:85%;           /*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%;
    border-top:0px solid #000;
    background-color: #fff;
}
#footer p {
    padding:10px;
    margin:0;
}
  • The page you link to works for me. Perhaps you could post some HTML or (even better) a link to a page you have made that doesn't work? Doug over 6 years ago

1 answer

0
points

Here is an article I ran across a while ago that deals with a three column layout. See if THIS works for you. Good luck.

Answered over 6 years ago by John Turknett