我在我的网站中使用一个表和表单元格。最左边的列需要从顶部开始。相反,它进入了底部。下面是灰色div从最底部开始的问题的链接。
http://jsfiddle.net/HtAJw/9/
目前还不清楚您想要实现什么样的最终结果。但是,通过向每个元素添加一个像素width
,它的总和小于或等于容器宽度,将防止您看到的包装。
http://jsfiddle.net/HtAJw/10/
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;
}