height 100% doesn't work, two divs inside div

后端 未结 8 1557
伪装坚强ぢ
伪装坚强ぢ 2021-01-22 19:45

See css: http://jsfiddle.net/4JgA4/114/

Also here:

相关标签:
8条回答
  • 2021-01-22 20:31

    because your parent div does not have property of height with height :100% you should have height:specific height on parent element,but you have min-height ,if the height is dynamic you should use jQuery to do this

    0 讨论(0)
  • 2021-01-22 20:33

    it doesnt get height because the parent div has no height. use below code

    <div style="height:150px; border:solid 1px black; float:left;">
        <div style="border:solid 1px black;height:100%;  float:left;">
        First to set height
        </div>
    
        <div style="border:solid 1px red; height:100%; float:left;">
        Why don't get the 100%
        </div>
    </div>
    
    0 讨论(0)
提交回复
热议问题