-1
我在我的網站中使用表格和表格單元格。最左邊的列需要從頂部開始。相反,它走向了底部。下面是這個問題的鏈接,灰色div從最底部開始。表格單元在div中不起作用
我在我的網站中使用表格和表格單元格。最左邊的列需要從頂部開始。相反,它走向了底部。下面是這個問題的鏈接,灰色div從最底部開始。表格單元在div中不起作用
目前還不清楚到底是什麼導致你希望實現的。但是,通過爲每個元素添加一個像素width
(它加起來小於或等於容器寬度),將會阻止您看到的包裝。
HTML:
<div class="parent">
<div class="child">
<fieldset>
a
</fieldset>
</div>
<div class="child" >
<div class= "newChildLeft">
a <br/> b<br/> b<br/> b<br/>
</div>
<div class= "newChildRight">
b<br/> b<br/> b
</div>
</div>
</div>
CSS:
.parent {
width: 100px;
display: table;
border: 1px solid green;
height: 100%
}
.child {
background: blue;
display: table-cell;
height: inherit;
width: 50px;
}
.newChildLeft {
float: left;
width: 25px;
}
.newChildRight {
float: right
width: 25px;
}
.child + .child {
background: red;
width: 50px;
}
fieldset {
height: 100%;
background-color: #666;
width: 50px;
}