圣杯布局
<body>
<header>header</header>
<div class="flex-box" >
<div class="flex-left">@yield('left')</div>
<div class="flex-center">@yield('text')</div>
<div class="flex-right">@yield('right')</div>
</div>
<footer>footer</footer>
</body>
继承
@extends('layout.shengbei')
@section('title','添加用户')
@section('content')
<x-alert ></x-alert>
@parent
@endsection
圣杯样式
<style>
* {
color: #fff;
text-align: center;
}
header {
background-color: lightblue;
height: 150px;
width: 100%;
line-height: 150px;
color:black;
}
.flex-box {
display: flex;
}
.flex-center {
background-color:#DCB5FF;
flex-grow: 1;
height: 400px;
width: 50px;
line-height: 400px;
}
.flex-left {
background-color: #81C0C0;
order: -1;
flex: 0 0 100px;
height: 400px;
width: 50px;
line-height: 400px;
}
.flex-right {
background-color: #C1FFE4;
flex: 0 0 100px;
height:400px;
width: 50px;
line-height: 400px;
}
footer {
background-color: #E0E0E0;
height: 150px;
width: 100%;
line-height: 150px;
color:black;
}
</style>