By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,481 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,481 IT Pros & Developers. It's quick & easy.

Gap between DIV and Container

KeredDrahcir
100+
P: 426
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:
Expand|Select|Wrap|Line Numbers
  1. .my_div{
  2.     border: 0px solid #ffffff;
  3.     width: 272px;    
  4.     vertical-align: top;
  5.     padding-top: 0;
  6.     margin-top: 0;
  7.     padding-bottom:0;
  8.     margin-bottom: 0;
  9. }
  10.  
  11. .my_div div{
  12.     background: url(../images/column_bg.jpg) repeat-y;
  13.     padding: 0 0 0 0;
  14.     margin: 0 0 0 0;
  15. }
HTML:
Expand|Select|Wrap|Line Numbers
  1. <div class="my_div">
  2.   <div>
  3.     <h3>Title</h3>
  4.       <div><p>Contwnt</p></div>
  5.   </div>
  6. </div>
Can anyone suggest how to get both division the same height.
Jun 27 '11 #1
Share this Question
Share on Google+
3 Replies


ilya Kraft
100+
P: 134
Alright try this,

Expand|Select|Wrap|Line Numbers
  1. .my_div{
  2.     width:272px;    
  3.     vertical-align:top;
  4.     padding-top:0;
  5.     margin:0;
  6. }
  7.  
  8. .my_div div{
  9.     background: url(../images/column_bg.jpg) repeat-y;
  10.     padding:0;
  11.     margin:0;
  12. }
  13.  
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.
Jun 27 '11 #2

KeredDrahcir
100+
P: 426
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.
Jun 28 '11 #3

KeredDrahcir
100+
P: 426
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?
Jun 28 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.