html - Css Wrapper 和容器 Div 自动高度?

标签 html css

我希望 div 高度设置为自动。

http://bit.ly/rubikss1

最下面的div里面是出来的。我想要底部的 div 延伸到。

请帮忙!

body,html{height:100%}

.wrapper{
	width: 700px;
        height: 100%;
	margin: 25px auto;
        overflow:hidden;
        position: relative;
}

.inner-container{
	width: 100%;
	height: 100%;
	float: left;
	border-radius: 5px;
	background: rgba(255,255,255,.5);
	position: relative;
}

.button-container{
	float: left;
	width: 100%;
	height: 35px;
	position: absolute;
	z-index: 2;
}

#prev, #next{
	border: 0;
	background: #5CB85C;
	padding: 5px 10px;
	color: #fff;
	border-radius: 2px;
	cursor: pointer;
	font-size: 18px;
}

#next{
	float: right;
}

#prev{
	float: left;
}

#verilistesi{
	float: left;
	width: 700px;
        height: 100%;
	position: relative;
	overflow: hidden;
}

#verilistesi .item-container{
	width: 100%;
	float: left;
}

#verilistesi .item-container .item{
	width: 500px;
        height: 100%;
	background: rgba(0,0,0,.3);
	margin-bottom: 35px;
	margin-top: 50px;
	position: relative;
	overflow: hidden;
}

我的 CSS。

如何设置两个 div 的自动高度?请帮忙?

最佳答案

我想这就是你想要的:

        body,html{height:100%}

        .wrapper{
            width: 700px;
            height: auto;
            margin: 25px auto;
            overflow:hidden;
            position: relative;
        }

        .inner-container{
            width: 100%;
            height: auto;
            float: left;
            border-radius: 5px;
            background: rgba(255,255,255,.5);
            position: relative;
        }

        .button-container{
            float: left;
            width: 100%;
            height: 35px;
            position: absolute;
            z-index: 2;
        }

        #prev, #next{
            border: 0;
            background: #5CB85C;
            padding: 5px 10px;
            color: #fff;
            border-radius: 2px;
            cursor: pointer;
            font-size: 18px;
        }

        #next{
            float: right;
        }

        #prev{
            float: left;
        }

        #verilistesi{
            float: left;
            width: 700px;
            height: auto;
            position: relative;
            overflow: hidden;
        }

        #verilistesi .item-container{
            width: 100%;
            float: left;
        }

        #verilistesi .item-container .item{
            width: 500px;
            height: 100%;
            background: rgba(0,0,0,.3);
            margin-bottom: 35px;
            margin-top: 50px;
            position: relative;
            overflow: hidden;
        }

关于html - Css Wrapper 和容器 Div 自动高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32439870/

相关文章:

jquery - 让 div 像复选框一样工作

html - css 形状内的随机文本

javascript - 颜色仅从颜色选择器更改特定页面的背景

CSS 图像/背景缩放

javascript - Asp.net 2.0网页_播放文件mp3、mp4

html - 使用 CSS 自定义 HTML <select>

javascript - 根据可用的屏幕空间将动态高度设置为 div

css - mvn tomcat :run does not pick up css files

javascript - 如何根据点击元素获取DIV索引号

javascript - Netbeans 8.1 HTML5/JavaScript 项目类型