You can fix the problem by assigning width to two tables.
Add the following CSS rule:
table {
width: 100%;
}
, ,
, div .
200 .
:
<div style="height:44px;background:green;width:200px">
200px 191px, , -,
, .
width: auto ( ) table,
, , .
CSS , /.
. : http://jsfiddle.net/audetwebdesign/gd8hL1d9/
. , , div
200 . , 220px, , .
, , , , ,
..
Div
:
<div class="parent">
<div class="timeUnit">
<div class="tickUnit t1"></div>
<div class="tickUnit t2"></div>
<div class="tickUnit t3"></div>
<div class="tickUnit t4"></div>
<div class="tickUnit t5"></div>
<div class="tickUnit t6"></div>
<div class="tickUnit t7"></div>
<div class="tickUnit t8"></div>
</div>
</div>
.timeUnit , .
CSS:
.parent {
height: 40px;
background-color: green;
overflow: auto;
width: 1000px;
}
.timeUnit {
border-left: 1px solid orange;
background: lightgray;
width: 199px;
height: inherit;
float: left;
}
.tickUnit {
border-left: 1px solid orange;
width: 24px;
height: 50%;
float: left;
position: relative;
top: 50%;
}
.tickUnit.t1 {
border-left: none;
}
.timeUnit, 199
.
.timeUnit 8 div, .tickUnit 24px 1px
. 50%,
.
, .
: http://jsfiddle.net/audetwebdesign/5j75Ltek/
CSS
.
HTML :
<div class="parent"><div class="timeUnit">
<div class="tickUnit t1"></div>
<div class="tickUnit t2"></div>
<div class="tickUnit t3"></div>
<div class="tickUnit t4"></div>
<div class="tickUnit t5"></div>
<div class="tickUnit t6"></div>
<div class="tickUnit t7"></div>
<div class="tickUnit t8"></div>
</div><div class="timeUnit">
<div class="tickUnit t1"></div>
<div class="tickUnit t2"></div>
<div class="tickUnit t3"></div>
<div class="tickUnit t4"></div>
<div class="tickUnit t5"></div>
<div class="tickUnit t6"></div>
<div class="tickUnit t7"></div>
<div class="tickUnit t8"></div>
</div></div>
, div, .
CSS:
.parent {
height: 40px;
background-color: green;
overflow: hidden;
width: 1000px
white-space: nowrap;
}
.timeUnit {
border-left: 1px solid orange;
background: lightgray;
width: 199px;
height: inherit;
display: inline-table;
vertical-align: top;
}
.tickUnit {
width: 12.5%;
height: 50%;
background-color: transparent;
display: table-cell;
vertical-align: bottom;
}
.tickUnit:before {
content:'\a0';
display: inline-block;
border-left: 1px solid orange;
}
.tickUnit.t1:before {
border-left: none;
}
CSS display: inline-table .timeUnit
display: table-cell .tickUnit 12,5%.
, , .
. : http://jsfiddle.net/audetwebdesign/skagwx61/
CSS / .