2 回答
TA贡献1841条经验 获得超3个赞
只需添加min-vh-100您的.container班级并添加align-content-center您的row班级即可。
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<div class="container d-flex min-vh-100">
<div class="row">
<div class="col-sm-7 about-us">
<div class="row h-100 justify-content-center align-items-center align-content-center flex-column">
<h3 class="display-3 strong ">Message From Chief</h3>
<p>This is a sample text</p>
</div>
</div>
<div class="col-sm-4">
<img src="{{asset('img/user.jpg') }}" class="img img-fluid" alt="">
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
TA贡献1900条经验 获得超5个赞
只需添加.h-100您的 .container 类,添加.h-100您的 row 类并添加.my-auto您的 col 类。
<div class="container h-100">
<div class="row h-100">
<div class="col-sm-7 about-us my-auto">
<div class="row h-100 justify-content-center align-items-center">
<h3 class="display-3 strong ">
{{ __('Message From Chief ') }}
</h3>
<p>
{{ __('This is a sample text') }}
</p>
</div>
</div>
<div class="col-sm-4">
<img src="{{asset('img/user.jpg') }}" class="img img-fluid" alt="">
</div>
</div>
</div>
- 2 回答
- 0 关注
- 95 浏览
添加回答
举报