Results 1 to 2 of 2

Thread: div height problem

  1. #1
    nepoverljiv is offline New Member: Posts Will Be Moderated
    Join Date
    Mar 2011
    Posts
    2

    Post div height problem

    Hi, I try to make two layer inside one layer, and one layer who will be "pull" these two to make same heights for both layers, left and right. Shortly, my code is:

    Code:
        <div id="main-body">  
            <div id="left">
                       left
            </div>  <!-- left-->
    
            <div id="right">
                          right
            </div>  <!-- right--> 
            
            <div id="floatanchor">&nbsp;</div> 
            
            </div> <!-- main-body -->
    and CSS is:

    Code:
    #main-body {
        margin: 0 auto;
        width: 987px;
        height: auto;
        margin-top: 0px;
    }
    
    #left{
        width:683px;
        float: left;
        background-color: fuchsia;
        height: auto;
    }
    
    #right{
        width:304px;
        float: right;
        background-color: aqua;
        height: auto;
    }
    
    #floatanchor {
        width: 987px;
        height: 10px;
        clear: both;
        background-color: blue; 
    }

    So, how to make right layer to have same height, like left layer, in situation where in left layer have some text, and right layer is have just one word. Anyone help me?

  2. #2
    nepoverljiv is offline New Member: Posts Will Be Moderated
    Join Date
    Mar 2011
    Posts
    2
    Solutions:

    #main-body {
    margin: 0 auto;
    width: 987px;
    height: auto;
    margin-top: 0px;
    overflow: hidden;
    }

    #left {
    width:683px;
    float: left;
    margin-bottom: -2000px; padding-bottom: 2000px;
    }

    #right {
    width:304px;
    float: right;
    margin-bottom: -2000px; padding-bottom: 2000px;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •