Css “自动高度”不起作用,只有“最小高度”起作用

Css “自动高度”不起作用,只有“最小高度”起作用,css,Css,我在页面上有一个元素,我需要在其中设置高度:auto,但它不能按我想要的方式工作。只有最小高度起作用,但当它大于此值时,文本将转到下一个元素。重要的是要说,我是返工下载的模板。其他地方高度:自动工作,但不在这里。我把代码包括在下面。我已经尝试过溢出:自动;但它只是在最小高度值的大小中添加了滚动条 HTML: 解决了!我必须为.front内容类添加异常,因为只有以下内容: .front-content{ position: absolute; left: 50%; z-in

我在页面上有一个元素,我需要在其中设置高度:auto,但它不能按我想要的方式工作。只有最小高度起作用,但当它大于此值时,文本将转到下一个元素。重要的是要说,我是返工下载的模板。其他地方高度:自动工作,但不在这里。我把代码包括在下面。我已经尝试过溢出:自动;但它只是在最小高度值的大小中添加了滚动条

HTML:


解决了!我必须为.front内容类添加异常,因为只有以下内容:

.front-content{
    position: absolute;
    left: 50%;
    z-index: 5;
}
所以我不得不编辑它。日期块:


你想针对什么元素?这里有一堆代码,是的,很抱歉,但我想在这里展示整个元素。我想影响父元素,它的图像背景为:dates>div:nth-of-type1
#dates>div:nth-of-type(1) {
    background: url(../img/parallax/01.jpg) 50% 0% repeat-y fixed;
    background-color: #333333;
    margin: 0;
    height: auto !important;
  min-height: 200px;
    position: relative;
    width: 100%;
    text-align: center;
/*  background-size: 100%;*/

    -moz-background-size: cover !important;
    -o-background-size: cover !important;
    -webkit-background-size: cover !important;
    -khtml-background-size: cover !important;
}
.parallax-wrapper.dates {
    height: auto;
  min-height: 200px;
    position: static;
    width: 100% !important;
    /*min-width: 1000px;*/
    margin: 0;
    padding: 0;
}

.parallax-wrapper.dates h1 {
color: white;
}

.front-content.dates{
    width: 500px;
    margin-left: -250px;
}
.dates-wrapper{
    width: 600px;
    height: auto;
  min-height: 200px;
    position: relative;
    overflow: hidden;
    margin-left: 10px;
}
.dates-wrapper ul li{
    float: left;
    width: 600px;
}

.date-box{margin-bottom: 12px;}
.date-box:last-child{margin-bottom: 0;}
.date-box .info{
    float: left;
    text-align: left;
    padding-left: 10px;
    color: #bbb;
    max-width: 170px;
    overflow: hidden;
    font-size: 14px;
}
.date-box .info div{position: relative;}
.date-box .info.date{
    width: 65px;
    height: 80px;
    background: #ee6c00;
    color: #fff;
    text-align: center;
    padding-left: 0;
}
.front-content{
    position: absolute;
    left: 50%;
    z-index: 5;
}
.front-content.dates{
    position: relative;
    z-index: 5;
  padding: 5px 10px 25px 10px;
}