···
<html>
<head>
<meta charset="utf-8">
<title>@yield("title",'圣杯布局')</title>
</head>
<style>
*{
color: #fff;
text-align: center;
}
header{
background-color: lightpink;
height: 150px;
width: 100%;
line-height: 150px;
}
.flex-box{
display: flex;
}
.flex-left{
background-color: lightgoldenrodyellow;
flex: 0 0 200px;
height: 400px;
width: 100px;
line-height: 400px;
}
.flex-right{
background-color: lightgoldenrodyellow;
flex: 0 0 200px;
height: 400px;
width: 100px;
line-height: 400px;
text-align: center;
}
.flex-center{
background-color: lightblue;
flex-grow: 1;
height: 400px;
width: 50px;
line-height: 400px;
text-align: center;
}
footer{
background-color: lightpink;
height: 150px;
width: 100%;
line-height: 150px;
text-align: center;
}
</style>
<body>
<header>header</header>
<div class="flex-box">
<div class="flex-left">@yield('left')</div>
<div class="flex-center">@yield('main')</div>
<div class="flex-right">@yield('right')</div>
</div>
<footer>footer</footer>
</body>
</html>
···
@extends('layout.shengbeibuju')
@section('title','shengbeibuju')
@section('left')
<p>left</p >
@endsection
@section('main')
<p>center</p >
@endsection
@section('right')
<p>right</p >
@endsection