SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why does my sidebar keep getting pushed out

    hey, im trying to get my sidebar and content parallel and the sidebar just gets pushed below the content part i have tried putting the div for the sidebar above the div for content but then it just pushes it to the top any help

    http://jsfiddle.net/75NTr/

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,297
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Hi j4m35x21. Welcome to the forums.

    Start with something neater and tidier like this:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>My title</title>
    
    <style>
    * {margin: 0; padding: 0;}
    
    body {
        background: url('../Route66Logo_COLOR.jpg');
        background-position:center center;
        background-repeat: no-repeat;
        font-family: Times New Roman, Verdana, Arial, Helvetica, sans-serif;
        font-size: 14px;
        color:#CC0000
    }
    
    p  {
        padding: 2px 0;
    }
    
    #wrapper {
        width: 80%;
        margin:0 auto;
    }
    
    #header {
        height: 150px;
        background: #000000;
    }
    
    
    #navigation {
        color:#000;   
        height: 15px;
        background: #cc0000;
    }
    
    #contentliquid {
    	background: rgb(0, 0, 0);
        background: rgba(0, 0, 0, 0.85);
        overflow: hidden;
    }
    
    #content {
        margin-left: 160px;
    }
    
    #leftcolumn {
        float:left;
        width: 140px;
        position: relative;
    }
    
    #footer {
        height: 40px;
        background: #000000;
        clear: both;
    }
    </style>
    
    </head>
    
    <body>
    <div id="wrapper">
    	<div id="header">
    		<p>This is the Header</p>
    	</div>
            
            <div id="navigation">
    		<p>This is the Menu</p>
    	</div>
    	
    	<div id="contentliquid">
    		<div id="leftcolumn">
    	        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla.</p>
    	    </div>
    	    
    	    <div id="content">
    	        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. 
    	                </p>
    	        <p>Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Suspendisse in justo eu magna luctus suscipit. Sed lectus. Integer euismod lacus luctus magna. Quisque cursus, metus vitae pharetra auctor, sem massa mattis sem, at interdum magna augue eget diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi lacinia molestie dui. Praesent blandit dolor. 
    	                </p>
    	        <p>Sed non quam. In vel mi sit amet augue congue elementum. Morbi in ipsum sit amet pede facilisis laoreet. Donec lacus nunc, viverra nec, blandit vel, egestas et, augue. Vestibulum tincidunt malesuada tellus. Ut ultrices ultrices enim. Curabitur sit amet mauris. Morbi in dui quis est pulvinar ullamcorper. Nulla facilisi. Integer lacinia sollicitudin massa. Cras metus. Sed aliquet risus a tortor. Integer id quam.</p>
    	    </div>
    	</div>
    
    	<div id="footer">
    		<p>This is the Footer</p>
    	</div>
    
    </div>
    
    </body>
    </html>
    Then, to get the padding on things like the columns, add a widthless inner div and put the padding on that instead. Otherwise your main widths will get messed up.

  3. #3
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you, i have got it sorted i have done basically what you said, i deleted the content and siderbar, retyped the code of what i wanted and it worked. Would like to understand what i did wrong but at least its working


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
  •