我有一个div的以下css代码,我希望有一个最小高度,然后根据需要增加高度。我不知道为什么但CSS不能在任何浏览器中工作!我试着谷歌答案,但还是没能!
任何帮助都会非常感激!
.container {
width: 1024px;
margin-right: auto;
margin-left: auto;
left: auto;
right: auto;
background-color: #FFFFFF;
box-shadow: 0 1px 3px rgba(34,25,25,0.4);
-webkit-box-shadow: 0 2px 12px rgba(34,25,25,0.4);
moz-box-shadow: 0 1px 2px rgba(34,25,25,0.4);
background-repeat: repeat-y;
height: auto !important;
height: 1024px;
min-height: 1024px;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #999;
padding-bottom:60px;
position:relative;
}
容器div应该随着div高度的增加而增长,当数据输入mysql表时会增加,然后显示在div中:
.udis {
float: left;
height: auto;
width: 680px;
position: relative;
box-shadow: 0 1px 3px rgba(34,25,25,0.4);
-webkit-box-shadow: 0 2px 12px rgba(34,25,25,0.4);
moz-box-shadow: 0 1px 2px rgba(34,25,25,0.4);
margin-left:10px;
min-height:620px;
height:auto!important;
height:620px;
}
答案 0 :(得分:1)
尝试删除该行:
height: 1024px;
答案 1 :(得分:1)
您应该从css
中删除height属性width: 1024px;
margin-right: auto;
margin-left: auto;
left: auto;
right: auto;
background-color: #FFFFFF;
box-shadow: 0 1px 3px rgba(34,25,25,0.4);
-webkit-box-shadow: 0 2px 12px rgba(34,25,25,0.4);
moz-box-shadow: 0 1px 2px rgba(34,25,25,0.4);
background-repeat: repeat-y;
min-height: 1024px;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #999;
padding-bottom:60px;
position:relative;