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 3 of 3
  1. #1
    Junior Member
    Join Date
    May 2007
    Member #
    Gurus ~

    I'm mired again, and back to beg for more help.
    Once again I have a problem that seems insurmountable, and once again I'm hoping to be proved wrong.

    I need to position two elements at the top-right and top-left corner of a single box, and I need those elements to push other block elements down.

    I have tried float, and I have tried using position:absolute within position:relative. Both of these attributes remove the element from the document flow, such that other block-level elements can actually end up behind or in front of them. I need to avoid this - I need these essentially right- and left- aligned blocks (right now they're divs) to push other block-level elements downward. Ideally, I'd like them to also affect the vertical size of their containing block (which, at present, neither does), but I'd be more than content with a solution
    that doesn't.

    To make things clearer, I've attached an image that might help explain what I'm looking for.

    Any advice?
    Attached Images Attached Images


  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Maryland, US
    Member #
    21 times
    An absolute element is always out of the document flow and there's nothing you can do about it. With a floated element, try setting a margin-left/right equal to the width of the element; same with margin-top/bottom and its height.
    filburt1, Web Design founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    May 2007
    Member #
    filburt1 ~

    Ah, yes, sorry, I should have mentioned that. Yes! That is in fact a great way to fix the issue, when I know the vertical size of the box (the one labeled "content div (float)" in my image). Unfortunately for the most part, I do not know the vertical size of this div - it is scaled to content. That is why I need another method. If I always knew the size of this div, I could use your method, or I could set the position of the next element (or the height of the container).

    So yeah, is there a way to do this while allowing the height of the floated box scale to its contents?

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

Search tags for this page

css float put back in document flow

Click on a term to search for related topics.
All times are GMT -6. The time now is 08:47 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: