WordPress.org

Ready to get started?Download WordPress

Forums

LOST in some simple CSS (7 posts)

  1. ThorHammer
    Member
    Posted 4 years ago #

    I am developing a theme with main content to the left and one sidebar to the right. But my sidebar doesnt align next to the content, but to the right of my window.
    Here is the troublesome CSS:

    #wrapper {
    	margin:0px auto 0px auto;
    	height: auto:
    	width: 880px;
    	text-align: left;
    	background-color: #ffffff;
    }
    #detail_listing_surround {
    	padding: 5px;
    	float: left;
    	height: auto;
    	width: 690px;
    	border: 1px solid #000000;
    }
    #sidebar {
    	float: right;
    	width: 180px;
    	text-align: left;
    	font: normal 11px 'Lucida Grande', Verdana, Arial, Sans-Serif;	margin:0x 0px 0px 10px;
      	padding: 0px 5px 0px 10px;
      	background-color: #ffffff;
    
    }

    And here is the template file...

    <body>
    <div id="wrapper">
    
    <div id="sidebar">sidebar</div>
    
    <div id="detail_listing_surround">
    All my stuff..............</div></div>

    Please..I am going nuts....

  2. Jabbok
    Member
    Posted 4 years ago #

    CSS gives me fits. I understand it but hunting a simple little fix drives me nuts.

    Maybe,

    #Sidebar
    fload: left (right now it's floating right)

  3. ThorHammer
    Member
    Posted 4 years ago #

    Nope.. when its declared to left, it appears as a LEFT sidebar, correctly aligned, but it is supposed to be a RIGHT sidebar...

  4. Jabbok
    Member
    Posted 4 years ago #

    Is there a link where we can look at what is troubling you?

  5. ThorHammer
    Member
    Posted 4 years ago #

    Hi!
    No, this is on my local xammp. But the problem lies somewhere in the code mentioned above. But I just cant see where and why myself.

  6. Peter Boosten
    Member
    Posted 4 years ago #

    Try it the other way around:

    <body>
    <div id="wrapper">
    
    <div id="detail_listing_surround">
    All my stuff..............
    </div>
    
    <div id="sidebar">sidebar</div>
    
    </div>

    and make #sidebar float: left;

    That way you 'pile' your floats from left to right. Some believe that content before links/navigation is better for SEO, so that would be a nice advantage as well.

    Peter

  7. ThorHammer
    Member
    Posted 4 years ago #

    Thanks, I will think about it! By the way: I solved the issue when I cleared left in detail_listing_surround...

Topic Closed

This topic has been closed to new replies.

About this Topic