shengbei.blade.php
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>@yield("title",'圣杯布局学习')</title>
</head>
<style>
* {
color: #fff;
text-align: center;
}
header {
background-color: yellowgreen;
height: 150px;
width: 100%;
line-height: 150px;
}
.flex-box {
display: flex;
}
.flex-left {
background-color: deepskyblue;
flex: 0 0 200px;
height: 400px;
width: 100px;
line-height: 400px;
}
.flex-center {
background-color: palegreen;
flex-grow: 1;
height: 400px;
width: 50px;
line-height: 400px;
}
.flex-right {
background-color: pink;
flex: 0 0 200px;
height:400px;
width: 100px;
line-height: 400px;
}
footer {
background-color: lightblue;
height: 150px;
width: 100%;
line-height: 150px;
}
</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>
create.blade.php
@extends('layout.shengbei')
@section('title','shengbei')
@section('left')
<p>left</p >
@endsection
@section('main')
<p>center</p >
@endsection
@section('right')
<p>right</p >
@endsection