0

I have this html sequence that displays 2 bars. Because inside the first div I display an inline list, I want to use display:table because it looks nicer in this way. The problem is that it extends the div, making it bigger with 20px (and moves the other div lower).

<div class="top-bar></div>
<div class="tail-bar></div>

.top-bar{       
    width: 520px;
    height: 50px;
    dispaly: table;
    background-color: #FFFFFF;  
}

EDIT: I added a JSFiddle http://jsfiddle.net/eCYUT/2/

It is the version without display:table tag

bogdan.herti
  • 1,110
  • 2
  • 9
  • 18

1 Answers1

1

The gap between the ul element and the div element was actually the margin related to the ul element.

To remove it, give margin-bottom: 0px to the class name of the ul element.

ul.stats{
    margin-bottom: 0px;
    /* other css properties */
}
Mr_Green
  • 40,727
  • 45
  • 159
  • 271