2014-03-04 223 views
0

我有一個特殊的divs結構,並希望兩個div的高度相同,而不需要在css中設置高度。任何人都可以幫我解釋爲什麼下面的jsFiddle不能按我的需要工作嗎?兩個div並排,相同的高度沒有設置高度

我在這裏試過很多類似的問題。但是沒有什麼對我完美的作品。

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> 

回答

0

你必須添加一些更多的div就像表格屬性:demo

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

啊,感謝名單了很多!這就是我要找的。 – user3378494