Results 1 to 4 of 4

Thread: div stacking

  1. #1
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default div stacking

    how do i get two floating divs to not stack when the window is minimized- meaning the div floated right drops below the div floated left, breaking the design. i've tried clear: both, min-width on parent and children, etc. please advise:

    .bnr
    {
    height: 75px;
    min-width: 741px;
    position:relative;
    width: 100%;

    }

    .bnrLft
    {
    background-image: url("../images/bnrLft.gif");
    float: left;
    height: 75px;
    width: 590px;
    }

    .bnrRgt
    {
    float: right;
    position:relative;

    }



    <div class="bnr">
    <div class="bnrLft">
    &nbsp;</div>
    <div class="bnrRgt">
    <a href="http://www.michigan.gov" target="blank">
    <img alt="image" src="images/bnrRgt.gif" /></a></div>
    </div>
    Last edited by rayray1; 04-11-2008 at 12:13 PM. Reason: source code and description

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I don't understand what you mean by stacking? Post your markup or better yet, a link to the page where this is happening.

  3. #3
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Try placing a wrapper around the two column-divs that is the width of the two column-divs combined.

    So...
    If you have one column at 600px, and another at 200px, create a wrapper div that is 800px.


    Now...when the window is contracted, the two content columns will not stack.

  4. #4
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Try placing a wrapper around the two column-divs that is the width of the two column-divs combined.

    So...
    If you have one column at 600px, and another at 200px, create a wrapper-div that is 800px, and place your content column-divs inside the wrapper-div.

    Simplified Example

    CSS Statements
    Code:
    #wrap {
    display: block;
    width: 800px;
    margin: 20px auto; /* 20px margins top and bottom - auto center left and right */
    }
    
    #colm-1 {
    display: block;
    width: 600px;
    }
    
    #colm-2 {
    display: block;
    width: 200px;
    }
    HTML Code
    Code:
    <div id="wrap">
    
        <div id="colm-1">
             blah blah blah stuff.
        </div name="CLOSE #colm-1">
    
        <div id="colm-2">
             blah blah blah more stuff.
        </div name="CLOSE #colm-2">
    
    </div name="CLOSE #wrap">
    Now...when the window is contracted, the two content columns should not stack.

    Hope this helped!

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
  •