Grow your CSS skills. Land your dream job.

Floating divs, with no set width

  • # August 24, 2009 at 6:08 am

    To begin with, since I’m fairly a newbie, I do hope that this question is easy to answer for more experienced designers.
    I have tried to search for a solution, but my english is not very strong, so I’m not quite sure how to express myself in short sentences when searching.

    Anyhow, I’m designing a theme for wordpress for a friend, and I want to have the standard sidebar on the right side, as usual.
    But I want the post to expand below the sidebar, so that it won’t be any white space below the sidebar.
    I’m floating the post-div to the left, and the sidebar to the right. I’ve also set the get_sidebar function before the post-loop runs.
    But it seems that when the posts have no set width they won’t fit at the same place where the sidebar is.
    And if I set width to the post-div so that it’ll fit beside the sidebar the white space below the sidebar will still be there.
    How to I get pass this problem?

    A visually example of how I want it to be:
    [img]http://i30.tinypic.com/1z4esnm.png[/img]
    or at least like this:
    [img]http://i28.tinypic.com/25hk6kw.png[/img]

    The live example:
    http://lepton.freehostia.com/index/blog

    # August 24, 2009 at 7:09 am

    Take the float off div.post and change div.post-title, div.full-date and div.post-tags to clear:left instead of clear:both. Lastly, change div.datebox to clear:left instead of float:left.

    # August 24, 2009 at 12:21 pm

    Thank you, for your quick reply :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".