How to create 3-column template from 2-column?

Discussion in 'CSS' started by BlackSeo, Apr 9, 2010.

  1. #1
    Welcome all DigitalPoint's users. I am newbie in CSS and I have a problem.

    I downloaded the Interactive Media css template from http://www.free-css.com/free-css-templates/page81/interactive-media.php.
    This template is 2-column, but I want to create 3-column template based on this Interactive Media template (by adding left column).
    So I copied these css styles, which are responsive for show right colum:
    #
    #right {    width:230px; float:right; margin: 0 0 20px 0; }
    
    #
        #right h2 { color:#fff; margin: 0 0 5px 0; font: bold 1.2em "Trebuchet MS", Arial; background: #fff url(../images/sideh2bg.gif) repeat-x; padding: 4px 10px; border-bottom: 2px solid #000; }
    
    #
        #right ul { list-style:none;    border-top:1px solid #eee; border:none; padding:0; margin:0 0 15px 0; }
    
    #
        #right ul li { border-bottom:1px solid #eee; padding:5px; margin:0; }
    
    #
        #right ul li a { border: 0; }
    PHP:
    And I replaced all #right for #leftsidebar

    Then I edited my index.php files: I added following lines:
    <div id="leftsidebar">
    <h2>Latest Entries</h2>
    			
    		</div>	
    PHP:
    after <div id="wrap">

    I also decreased size of left and right sidebar from 230 pixels to 115 pixels and I deleted float:left atribut from #left (#left in my template is not left column, but main column with news - 540 pixels.)

    I saved this and refreshed my website in Opera, Chrome and Internet Explorer.
    But website's layout does not like as good as I want.

    Sidebars are not look good.

    See on my screen:
    [​IMG]

    How I can create correct 3-column template based on Interactive Media?
    When I did a mistake?

    Sorry for my english. This language is not my native.

    Full css:
    /*
    
    	project: interactive media (free css template)
    	author: luka cvrk (www.solucija.com)
    	
    */
       
    * { margin:0; padding:0; }
    body { font: 72.5%/1.7em "Lucida Grande", "Lucida Sans Unicode", verdana, geneva, sans-serif; color:#555; background: #fff url(../images/headerbg.gif) repeat-x; }
    
    /* general styling */
    a { color:#007898; background: inherit; border-bottom:1px dotted #ccc; text-decoration:none; }
    a:hover { border-bottom:1px solid #ccc; color: #808080; background: inherit; }
    a:focus { outline: 0; }
    ul { margin:10px 10px 10px 0; padding:0 0 0 15px; }
    li { margin:0 0 0 10px; padding:3px; }
    img { border: 0; text-decoration: none; }
    
    /* content */
    .wrap { padding:0 10px 10px 10px; width:860px;margin: auto; }
    #logo {float:left; margin: 26px 20px 14px 5px; color:#768998; }
    h1 { margin: 0 0 10px; letter-spacing: 1px; font-size: 2em; }
    h1 a { color: #fff; }
    h1 a:hover { color: #FFFCB3; }
    	
    /* main navigation */
    #nav { float:right; border:none; padding:0; margin: 47px 10px 60px 0; }
    #nav li { float:left; list-style:none; margin:0 4px 0 0; padding:0; font-size: 1.1em; }
    #nav li a { display:block; padding: 10px 12px 15px; color:#768998; text-decoration:none; border: 0; margin:0 1px 0 0; }
    #nav li a:hover, #nav li a.current { background: url(../images/barbg.gif) no-repeat bottom center; color:#fff; }	
    	.akey { border-bottom: 1px dotted #4B5761; }
    
    #leftsidebar {	width:115px; float:left; margin: 0 0 20px 0; }
    	#leftsidebar h2 { color:#fff; margin: 0 0 5px 0; font: bold 1.2em "Trebuchet MS", Arial; background: #fff url(../images/sideh2bg.gif) repeat-x; padding: 4px 10px; border-bottom: 2px solid #000; }
    	#leftsidebar ul { list-style:none; 	border-top:1px solid #eee; border:none; padding:0; margin:0 0 15px 0; }
    	#leftsidebar ul li { border-bottom:1px solid #eee; padding:5px; margin:0; }
    	#leftsidebar ul li a { border: 0; }
    
    /* main content */
    #left { width: 540px; margin: 0 0 20px 0; }
    	#left h2 { font: 2.1em "Trebuchet MS", Arial; background: url(../images/h2bg.gif) repeat-x bottom; color:#121212; letter-spacing:-1px; margin: 0px 0 20px 0; clear:left; }
    	#left h2 a { color:#121212; text-decoration:none; border: 0; }
    	#left p { clear: both; margin: 5px 0 20px 0; font-size:110%; line-height:21px; }
    	
    /* sidebar */
    #right {	width:115px; float:right; margin: 0 0 20px 0; }
    	#right h2 { color:#fff; margin: 0 0 5px 0; font: bold 1.2em "Trebuchet MS", Arial; background: #fff url(../images/sideh2bg.gif) repeat-x; padding: 4px 10px; border-bottom: 2px solid #000; }
    	#right ul { list-style:none; 	border-top:1px solid #eee; border:none; padding:0; margin:0 0 15px 0; }
    	#right ul li { border-bottom:1px solid #eee; padding:5px; margin:0; }
    	#right ul li a { border: 0; }
    
    	#tagcloud { margin: 0 0 20px; }
    	#tagcloud a { margin: 0 5px 0 0; color: #25771F; }
    	#tagcloud a:hover { background: #E7FEE5; color: #007898; }
    	
    	#info { border: 1px solid #ccc; padding: 3px 5px; margin: 0 0 10px; }
    
    #footer { clear: both; border-top: 1px solid #ccc; padding: 20px 0; color:#808080; }
    #footer p { line-height: 2.5em; } 
    PHP:
     
    BlackSeo, Apr 9, 2010 IP