Gap between DIV and Container

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    Gap between DIV and Container

    I'm creating a box that had a container divsion and then an innner division for the content. However there is a gap of about ten pixel between the bottom of the container and a bottom of the inner divsion. I need them to be the same height since the inner divison has a image border that had to go all the way to the bottom.

    CSS:
    Code:
    .my_div{
    	border: 0px solid #ffffff;
    	width: 272px;	
    	vertical-align: top;
    	padding-top: 0;
    	margin-top: 0;
    	padding-bottom:0;
    	margin-bottom: 0;
    }
    
    .my_div div{
    	background: url(../images/column_bg.jpg) repeat-y;
    	padding: 0 0 0 0;
    	margin: 0 0 0 0;
    }
    HTML:
    Code:
    <div class="my_div">
      <div>
        <h3>Title</h3>
          <div><p>Contwnt</p></div>
      </div>
    </div>
    Can anyone suggest how to get both division the same height.
  • ilya Kraft
    New Member
    • Jan 2011
    • 134

    #2
    Alright try this,

    Code:
    .my_div{
        width:272px;    
        vertical-align:top;
        padding-top:0;
        margin:0;
    }
    
    .my_div div{
        background: url(../images/column_bg.jpg) repeat-y;
        padding:0;
        margin:0;
    }
    And I think it could be that background image that is causing the problem, make sure that heights are adjusted so background image matches div's.

    Comment

    • KeredDrahcir
      Contributor
      • Nov 2009
      • 426

      #3
      That hasn't made any difference. The background image needs to scroll to match the height of the division which can changes its height depending on what is put inside it.

      Comment

      • KeredDrahcir
        Contributor
        • Nov 2009
        • 426

        #4
        I've solved it. I added on pixel of bottom padding onto the
        .my_div div anf it's foxed it. Does anyone know why?

        Comment

        Working...