问题描述
我给min-height和display:table-cell for div但是min-height没有出现。请给出解决方案。
我尝试了什么:
。数据{
显示:table-cell;
vertical-align:中间;
最小高度:145px;
}
[适用于Edge和IE11,但它在Firefox v55,Chrome v60或Opera v47中不起作用。
应用 min-height
到子元素有效,但不尊重 vertical-align
设置: []
在单元格上设置 height
,而不是 min-height
,似乎有效: []
元素的高度仍将增加以适应内容: [ ]
I give min-height and display:table-cell for div but min-height not appear.please give solution.
What I have tried:
.data{
display: table-cell;
vertical-align: middle;
min-height: 145px;
}
This demo[^] works in Edge and IE11, but it doesn't work in Firefox v55, Chrome v60, or Opera v47.
Applying the min-height
to a child element works, but doesn't respect the vertical-align
setting: Edit fiddle - JSFiddle[^]
Setting the height
on the cell, instead of the min-height
, seems to work: Edit fiddle - JSFiddle[^]
The element's height will still increase to fit the content: Edit fiddle - JSFiddle[^]
这篇关于在div min-height中不显示:table-cell。仅取高度。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!