三列布局

左右固定寬度,中間自適應。css

//思路float
.float .left{
	float: left;
	width: 200px;
}
.float .right{
	float: right;
	width: 200px;
}

.float .center{
	margin: 0 200px;
}

  

//思路absolute
.absolute{
	position: relative;
}

.absolute .left{
	position: absolute;
	left: 0;
	width:200px;
}

.absolute .right{
	position: absolute;
	right: 0;
	width: 200px;
}

.absolute .center{
	position: absolute;
	left: 200px;
	right:200px;
}

  

//思路table
.table{
	display: table;
	width: 100%;
}

.table .left{
	display: table-cell;
	width: 200px;
}

.table .right{
	display: table-cell;
	width: 200px;
}

.table .center{
	display: table-cell;
}

  

//思路flex
.flex{
	display: flex;
}

.flex .left{
	width: 200px;
}

.flex .right{
	width: 200px;
}

.flex .center{
	flex: 1
}

  

//思路柵格grid
.grid{
	display: grid;
	width: 100%;
	grid-template-columns: 200px auto 200px;
}

  

//思路inline-block calc
.inline{
	font-size: 0;
}
		
.inline .left,.inline .right , .inline .center{
	display: inline-block;
	font-size: 18px;
}

.inline .left {
	width: 200px;
}

.inline .right {
	width: 200px;
}

.inline .center {
	width: calc(100vw - 434px);
}
相關文章
相關標籤/搜索