Results 1 to 4 of 4

Thread: Need help with CSS Template

  1. #1
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with CSS Template

    I recently found out that a table layout is no good, so I decided to switch over to CSS. Since I am not very familiar with CSS, I downloaded a CSS template from this website. I kind of got the hang of CSS and I managed to modify the template to match my design specifications, except for one thing.

    I would like to add two columns, one on each far side of the template. Click HERE to view a picture.

    I played around with the code and every attempt that I made to add these columns failed.

    Any help is greatly appreciated.


    Here is the template's 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>Home</title>

    <style type="text/css">
    body{
    margin:0;
    padding:0;
    }

    b{font-size: 12px;}

    #wrapper{
    width: 900px; /*Width of main container*/
    margin: auto; /*Center container on page*/
    }

    #topsection{
    border:1px solid black;
    background: #EAEAEA;
    }

    #header{
    border:1px solid black;
    background: #EAEAEA;
    height: 108px; /*Height of top section*/
    }

    #topnav{
    border:1px solid black;
    background: #EAEAEA;
    height: 28px; /*Height of top section*/
    }

    #contentwrapper{
    float: left;
    width: 100%;
    }

    #leftcolumn{
    border:1px solid black;
    float: left;
    width: 156px; /*Width of left column in pixel*/
    margin-left: -900px; /*Set margin to that of -(MainContainerWidth)*/
    background: #C8FC98;
    }

    #contentcolumn{
    border:1px solid black;
    width:478px;
    margin: 0 252px 0 166px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/
    }

    #rightcolumn{
    border:1px solid black;
    float: left;
    width: 244px; /*Width of right column*/
    margin-left: -246px; /*Set left margin to -(RightColumnWidth)*/
    background: #FDE95E;
    }

    #footer{
    border:1px solid black;
    clear: left;
    width: 898;
    background: #EAEAEA;
    text-align: center;
    }

    .innertube{
    margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
    margin-top: 0;
    }
    </style>
    </head>
    <body>

    <div id="wrapper">

    <div id="topsection">
    <div class="innertube">&nbsp;</div>
    </div>

    <div id="header">
    <div class="innertube">&nbsp;</div>
    </div>

    <div id="topnav">
    <div class="innertube">&nbsp;</div>
    </div>

    <div id="contentwrapper">
    <div id="contentcolumn">
    <div class="innertube"><b>Content Column</b></div>
    </div>
    </div>

    <div id="leftcolumn">
    <div class="innertube"><b>Left Column</b></div>
    </div>

    <div id="rightcolumn">
    <div class="innertube"><b>Right Column</b></div>
    </div>

    <div id="footer">&nbsp;</div>

    </div>
    </body>
    </html>

  2. #2
    Join Date
    Aug 2008
    Location
    Estados Unidos
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    I think you'll need to use position instead of float.

    Another option would be to create a wrapper inside your wrapper

    #wrapper{
    width: 900px; /*Width of main container*/
    margin: auto; /*Center container on page*/
    }
    #wrapper2{
    width: 700px; /*Width of inside container*/
    margin: auto; /*Center container on page*/
    }

    The problem with this approach is that you'll only be able to change background color and image for the columns. If you want content there you'll need to use the position property for the <div>s that you markup.

  3. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Please wrap your code in [CODE] tags when posting...
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  4. #4
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Try this...
    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>Home</title>
    
    <style type="text/css">
    body{
    margin:0;
    padding:0;
    }
    
    b{font-size: 12px;}
    
    #wrapper{
    width: 900px; /*Width of main container*/
    margin: auto; /*Center container on page*/
    height:auto !important;
    height:100%;
    }
    #wrapper_inner{
    width: 700px; /*Width of main container*/
    margin: auto; /*Center container on page*/
    height:auto !important;
    height:100%;
    }
    #leftside{
    width:100px;
    height:auto !important;
    height:100%;
    background:red;
    position:relative;
    top:0px;
    left:0px;
    clear:left;
    float:left;
    display:block;
    }
    #rightside{
    width:100px;
    min-height:100%;
    height:auto !important;
    height:100%;
    background:blue;
    position:relative;
    top:0px;
    right:0px;
    clear:right;
    float:right;
    display:block;
    }
    #topsection{
    border:1px solid black;
    background: #EAEAEA;
    }
    
    #header{
    border:1px solid black;
    background: #EAEAEA;
    height: 108px; /*Height of top section*/
    }
    
    #topnav{
    border:1px solid black;
    background: #EAEAEA;
    height: 28px; /*Height of top section*/
    }
    
    #contentwrapper{
    float: left;
    width: 100%;
    height:auto !important;
    height:100%;
    }
    
    #leftcolumn{
    border:1px solid black;
    float: left;
    width: 156px; /*Width of left column in pixel*/
    margin-left: -700px; /*Set margin to that of -(MainContainerWidth)*/
    background: #C8FC98;
    height:auto !important;
    height:100%;
    }
    
    #contentcolumn{
    border:1px solid black;
    width:auto;
    height:auto !important;
    height:100%;
    margin: 0 252px 0 166px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/
    }
    
    #rightcolumn{
    border:1px solid black;
    float: left;
    width: 244px; /*Width of right column*/
    margin-left: -246px; /*Set left margin to -(RightColumnWidth)*/
    background: #FDE95E;
    height:auto !important;
    height:100%;
    }
    
    #footer{
    border:1px solid black;
    clear: left;
    width: 898;
    background: #EAEAEA;
    text-align: center;
    height:25px;
    }
    
    .innertube{
    margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
    margin-top: 0;
    }
    
    </style>
    </head>
    <body>
    
    <div id="wrapper">
    
    <div id="leftside">This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...</div>
    <div id="rightside">This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...This is just filler text...</div>
    
    <div id="wrapper_inner">
    
    <div id="topsection">
    <div class="innertube">&nbsp;</div>
    </div>
    
    <div id="header">
    <div class="innertube">&nbsp;</div>
    </div>
    
    <div id="topnav">
    <div class="innertube">&nbsp;</div>
    </div>
    
    <div id="contentwrapper">
    <div id="contentcolumn">
    <div class="innertube"><b>Content Column</b></div>
    </div>
    </div>
    
    <div id="leftcolumn">
    <div class="innertube"><b>Left Column</b></div>
    </div>
    
    <div id="rightcolumn">
    <div class="innertube"><b>Right Column</b></div>
    </div>
    
    <div id="footer">&nbsp;</div>
    
    </div></div>
    </body>
    </html>
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

Bookmarks

Posting Permissions

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