Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2

Thread: CSS layout

  1. #1
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    HTML Code:
    <body>
    <div id="header"></div>
    <div id="mainblock">
    	
    	<div id="content">
    	This is the main content area.
    	</div>
    	
    	<div id="side">
    		<div class="block">links</div>
    		<div class="block">news</div>
    		<div class="block">sport</div>
    	</div>
    
    </div>
    
    </body>
    Im trying to get a layout with a content area, and a sidebar on the right hand side. The problem is that the sidebar appears below the content area. If I use relative postioning with a top: -500px , there is a huge amount of whitespace underneath.

    CSS:
    Code:
    #header {
    background-image: url(images/header.jpg);
    background-repeat: no-repeat;
    background-position: center;
    width: 788px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;}
    
    #mainblock {
    width: 788px;
    height: 500px;
    margin-left: auto;
    margin-right: auto;}
    
    #content {
    width: 640px;
    height: 500px;
    margin-left: 0px;
    margin-right: auto;
    background-color: #e0e0e0;}
    
    #side {
    width: 140px;
    height: 500px;
    background-position: right;
    margin-left: auto;
    margin-right: 0px;
    margin-top: 0px;
    float: right;
    }
    
    .block {
    background-image: url(images/block.gif);
    background-repeat: no-repeat;
    width: 132px;
    height: 167px;
    margin-left: auto;
    margin-right: 0px;}
    Help?

  2.  

  3. #2
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    Ok then. 1 line of code.

    Sorry bout the post. i solved it. in content div I added: float:left.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:33 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com