Bootstrap 行命中断点太迟
Bootstrap Row hits breakpoint too late
使用下面的当前代码,在尺寸为 234 x 668 之前,行不会垂直变化
.contbg {
background-color: #FF0000;
}
.rowbg {
background-color: #FFFF00;
}
.colbg {
background-color: #00ff00;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<a>TEST</a>
<div class="container-fluid">
<div class="row">
<div class="col colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
<div class="col colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
<div class="col colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
</div>
</div>
我试图让它在达到 450w 以下时重新排列,但是当我将 row-sm 添加到第一行时
<a>TEST</a>
<div class="container-fluid">
<div class="row-sm">
<div class="col colbg">
它使整个容器从一开始就垂直而不是水平。我该如何解决这个问题?
我遗漏了 col-sm-4 添加到每一列
.contbg {
background-color: #FF0000;
}
.rowbg {
background-color: #FFFF00;
}
.colbg {
background-color: #00ff00;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<a>TEST</a>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4 colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
<div class="col-sm-4 colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
使用下面的当前代码,在尺寸为 234 x 668 之前,行不会垂直变化
.contbg {
background-color: #FF0000;
}
.rowbg {
background-color: #FFFF00;
}
.colbg {
background-color: #00ff00;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<a>TEST</a>
<div class="container-fluid">
<div class="row">
<div class="col colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
<div class="col colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
<div class="col colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
</div>
</div>
我试图让它在达到 450w 以下时重新排列,但是当我将 row-sm 添加到第一行时
<a>TEST</a>
<div class="container-fluid">
<div class="row-sm">
<div class="col colbg">
它使整个容器从一开始就垂直而不是水平。我该如何解决这个问题?
我遗漏了 col-sm-4 添加到每一列
.contbg {
background-color: #FF0000;
}
.rowbg {
background-color: #FFFF00;
}
.colbg {
background-color: #00ff00;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<a>TEST</a>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4 colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>
<div class="col-sm-4 colbg">
<div class="container cont2">
<div class="row-2 rowbg">
TTITLE
</div>
<div class="row-10 rowbg">
<img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
</div>
</div>
</div>