两个div并排,相同的高度没有设置高度

时间:2014-03-04 10:22:01

标签: css3 html height containers

我有一个特殊的div结构,并希望两个div的高度相同,而不需要在css中设置高度。任何人都可以帮助我并解释为什么以下jsFiddle不能按我的意愿工作吗?

我在这里尝试过类似问题的很多东西。但是没有什么能对我有用。

jsfiddle

<div class="div-table">
<div>
    <div>Date</div>
    <div style="white-space:nowrap">
        <div class="input-field">
            <input>
        </div>
        <div class="input-img">
            <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAfJJREFUSEutlquSAjEQRSORSCQSiUQikUgkEonE8QlIPgGJRCKRSCQSiURm96Rysz0hM5t93KquSbrTzzQdnK/E5XLx5/O5QbXodHK73fxqtfKDwcA7596o3+/75XL5rcOik8fjEZStweFw6KfTaaLRaNSQw7ter9FCE29OOIhBKeOsTZlMN5tNyIizvV7PH4/HKP1CwwnGpEBk9/s9SrpB5pRVgeWOkhMMKgOi/w12u13KiEYRkpP5fJ4y+AvW63WwMx6PIyc6oUyKgNQFeKISSvLX65W6UWULUnUSUQhW2a4tLM+uVbbJZBL2Ds+6bLpFyI3me2B5do1NqgKPu3ZcEBv63gJeTjm65Lrj/X7vHXVjA/M/sd1ug93wDZ4+NzVtyzmoBtauOxwOYbNYLKK4HbUOgDJhIjiGGxt1Qhd+4kQTIHTa8/kMnQCxFkoG4YksSjxNj9BYMGazWWDgVSgpllA6p47FEQhSdRi/VHpckAFrxPJymUDp4XMfIJ1g1iDgwnJYg1AX1Eh2RCUNNQBUehNqwAzUL71R+vgNUG/nh2pAYBpPdJbFW+4abhAlPJ1OUVIG0fM8SCd3AIoFJir754EuYUJzXzjly6Xad54ytWXfeot0GUr2vS8RwRCAfYdytDqxoCRED1EasmBd99/L+w8meYWhCGsXpAAAAABJRU5ErkJggg==">
        </div>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

您必须添加更多具有表格属性的div,例如: demo

.table {
    display: table;
    width: 88%;
}
.row {
     display: table-row;
}