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 6 of 6
  1. #1
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    Ok, now, before you get angry i KNOW that a floated box cannot expand a div because its taken out of normal flow.

    However, I need to simulate it. I have something like this
    <div id="container">
    <div class="roundTop"></div>
    <div class="inner">
    <div id="floatLeftBox">
    The content in this left floated box will be dynamic and will have to
    expand the floatLeftBox div, as well as the container div
    </div>
    <div id="rightBox">
    This content is a certain height and will never expand, ive been setting a height
    on this box to expand the container div as the floatLeft gets bigger.
    Now that floatLeft is dynamic, i cannot artifically expand container by setting a height on rightBox
    </div>
    </div>
    <div class="roundBottom"></div>
    </div>

    Now, is there anyway to do this properly.
    Im pretty good with css, but i just cant figure this one out.

    I tried floating rightBox right, but it shows up underneath leftbox

  2.  

  3. #2
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    Can you give us a url please? Much easier to work with.

  4. #3
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    I use floated boxes inside divs all the time and the containing div expands with the content, so I don't think I understand your question. Do you have a url or the complete code and css?(just the code for that section)

  5. #4
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    i figured this out...
    floated boxes do NOT expand divs, so i dont know how yours do :S
    floated boxes are taken out of normal flow and not used in the calculation
    UNLESS there is something under it (within the same container)

    so

    <div class="floatLeft">

    </div>
    <p>More content</p>

    wont show a problem, in the situation above (my first post) the only content in my div were contain in a left div and a right div, the left div was floated left (but it was the bigger div and i needed it to expand the container)

    how i solved it

    at the bottom of both divs i added
    <div class="clear"></div>

    and in my css
    .clear{clear: both;}

    thanks for your help though, and sorry i couldnt link to a url, its for a client and its password protected =)

  6. #5
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Ahh yes, "unless something is underneath". I always have something underneath, like at least a footer, so I never see that problem!

  7. #6
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    ya, ur footer probably has clear: both in ur css.
    and ur floated boxes are probably the containers themselves

    my floated boxes arent top level containers
    <div id="myContainer">
    <div id="leftBox">
    this is floated left, if its content is bigger then rightBox
    #myContainer wont expand properly
    </div>
    <div id="rightBox">

    </div>
    <div class="clearLeft"></div> this line places an element under leftBox, which expands the #myContainer div higher than leftBox
    </div>

    the way my pages was designed, i need to have a clearing div , inside the container div and after the left floated and right div. in the case above myContainer isnt my wrapper, its just a div on my page among many others. a footer that clears would help because its outside myContainer and would not help it expand cuz its clearing nothing

    thanks for ur help


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:59 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com