设置:
必填:
我尝试使用self-align-end,但是它仅适用于一行中的列,而不适用于容器中的行。
先谢谢了;)
摘要:
.row:last-child {
position: fixed;
bottom: 0;
left: 0;/*optional*/
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container-fluid bg-dark" style="height: 100vh;">
<div class="row bg-warning container-fluid no-gutters justify-content-start">
This is Row 1
</div>
<div class="row bg-danger container-fluid no-gutters justify-content-center">
This is Row 2
</div>
<div class="row bg-warning container-fluid no-gutters justify-content-end">
This is Row 3
</div>
<div class="row bg-success container-fluid no-gutters justify-content-center">
This is Row 4
</div>
</div>
答案 0 :(得分:0)
为此container
d-flex align-items-end
/*.row:last-child {
position: fixed;
bottom: 0;
left: 0;
}*/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container-fluid bg-dark d-flex align-items-end" style="height: 100vh;">
<div class="row bg-warning container-fluid no-gutters justify-content-start">
This is Row 1
</div>
<div class="row bg-danger container-fluid no-gutters justify-content-center">
This is Row 2
</div>
<div class="row bg-warning container-fluid no-gutters justify-content-end">
This is Row 3
</div>
<div class="row bg-success container-fluid no-gutters justify-content-center">
This is Row 4
</div>
</div>
答案 1 :(得分:0)
添加“ d-flex align-content-end flex-wrap”
尝试一下。
/*
.row:last-child {
position: fixed;
bottom: 0;
left: 0;
}*/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container-fluid bg-dark d-flex align-content-end flex-wrap" style="height: 100vh;">
<div class="row bg-warning container-fluid no-gutters justify-content-start">
This is Row 1
</div>
<div class="row bg-danger container-fluid no-gutters justify-content-center">
This is Row 2
</div>
<div class="row bg-warning container-fluid no-gutters justify-content-end">
This is Row 3
</div>
<div class="row bg-success container-fluid no-gutters justify-content-center">
This is Row 4
</div>
</div>