当元素使用flex布局,子级无法设置高度怎么办?

1.使用绝对定位

html

	
头部
内容

css

html,body{
	width:100%;
	height:100%;
}
.wrap{
	width:100%;
	height:100%;
}
.header,.footer{
	height:40px;
}
.main{
	display:flex;
	postion:relative;
}
.container{
	position:absolute;
	width:100%;
	height:100%;
}

其他

整理收集了我自己学习过程中看过的书籍和一些其他准备看的书籍,希望对大家有帮助,接下来还会陆续更新上去新的书籍:
tc5.us/dir/24655972-37630821-7fb57f

你可能感兴趣的:(日常笔记,flex,布局)